From: Dave Thomas Date: 2000-10-14T07:49:16+09:00 Subject: [ruby-talk:5527] Re: class messages in Ruby faatdilac@my-deja.com writes: > Are there class messages in Ruby and are they inheritable? Yes and no. You can specify a class as a receiver, but the message itself isn't special: you can specify a receiver for any message. So: class One def One.m1 # explicit receiver puts "m1" end end def One.m2 # explicit receiver puts "m2" end o = One.new def o.m3 # another explicit receiver puts "m3" end One.m1 #=> m1 One.m2 #=> m2 o.m3 #=> m3 In the first two cases, the receiver is the class object, and in the third the receiver is an instance of the class. Ruby documentation calls all three methods 'singleton methods', as they are methods associated with a single object. So Ruby support class messages without needing any special support for class messages. Regards Dave