From: Robert Klemme Date: 2006-07-09T06:50:27+09:00 Subject: Re: Definition of methods: self 2006/7/8, Damaris Fuentes : > Um...wait...Do I have to set the name of the class before the name of > the method when this method is a class method (except the "initialize")? Right, but no exception: initialize is an instance method. new is a class method and after a new instance is allocated initialize is called on that instance: $ ruby -e 'set_trace_func lambda {|*a| p a}; Array.new' ["line", "-e", 1, nil, #, false] ["c-call", "-e", 1, :new, #, Class] ["c-call", "-e", 1, :initialize, #, Array] ["c-return", "-e", 1, :initialize, #, Array] ["c-return", "-e", 1, :new, #, Class] Note, there is also allocate (class method) that will create an empty instance of the correct type. So new can be imagined as being implemented like this: class Class def new(*a,&b) o = allocate o.initialize(*a,&b) o end end Kind regards robert -- Have a look: http://www.flickr.com/photos/fussel-foto/