From: James Coglan Date: 2008-08-20T20:44:46+09:00 Subject: Re: ruby help ------=_Part_50315_24515309.1219232895711 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 2008/8/20 Sunny Bogawat > Can someone enlighten me about > > * Public Instance Methods. > * Public Class Methods. > * What is the root class for all Ruby Classes if there is one. This is a little vague, but I'll try to help. In Ruby, Object is the root class, and all classes (even Object) are instances of the Class class. Class inherits from Module, which inherits from Object. Object ^ | Module ^ | Class So Object, Module and Class are all Classes, and are also all Objects. Hope that makes sense. Public instance methods are defined within a class and can be called on instances of the class: class Foo def talk 'talking' end end f = Foo.new f.talk #=> 'talking' Class methods are defined on the class itself (notice the use of self): class Foo def self.something self.name end end Foo.something #=> 'Foo' 'Public' just means that a method can be called from outside the object by any other piece of code. Private methods can only be called inside an object by other methods in the same class. ------=_Part_50315_24515309.1219232895711--