From: Robert Klemme Date: 2009-05-28T07:00:10+09:00 Subject: Re: Initialize not being called on objects created from lite On 27.05.2009 22:08, Oliver Saunders wrote: > For those interested to know what I was doing I was trying to implement > a layer for prototype-based OO in Ruby. Didn't really work though. Please correct me if I am wrong, but you seem to mean http://en.wikipedia.org/wiki/Prototype-based_programming Would this approximate what you're after? prototype = Object.new class < As > far as I know (and please correct me if I'm wrong) Ruby doesn't allow > you to call a method redefining the meaning of self for the purpose of > the call (e.g. apply() in JS) and without this feature you can't really > implement this layer in any useful way. #instance_eval does exactly that: it temporarily sets self to point to a particular instance. But it seems apply() in JS world is used to do something else http://www.devguru.com/Technologies/ecmascript/quickref/apply.html Basically you would need it to call "super class" methods. A few solutions come to mind. For construction you can do def base o = Object.new class <