------ art_11501_6210631.1185708352470 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/29/07, Guo Yangguang <gyg22 / 163.com> wrote: > > Sorry ,i am not show it very clear.Please read this example again: > > class Test > def Test.say_hello > puts "Hello from #{self.name}" > puts "hello from #{self.class}" > end > say_hello #i don't understand here > end Try this on for size: class Test puts "Self is" p self puts "Test is" p Test puts "Test self?" p( Test self ) def Test.say_hello puts "Hello" end say_hello Test.say_hello self.say_hello end In the body of a class block, self is the class. That's why you can call the "class" method right there, after defining it. Normally,we can use a class anyplaces after defining it ,but in this > example,i use a classmehod immediately after defining it "in class > context".This is valid.I means calling a classmethod(not an intance > method) in a class defintion--not after defining that class--is valid > .Can you explain it for me? thank you ! > > > > > > > > > Robert Dober wrote: > > On 7/29/07, Guo Yangguang <gyg22 / 163.com> wrote: > >> end > >> say_hello > >> end > >> > > It is not completely clear what you want to achieve but some remarks > > might be helpful > > > > class Test > > def initialize > > e「 」 ャ セ セ ャ コ セ セ タ 「 」 セ セ セ セ セ セ ゜ コ 」 セ セ セ セ ヤョ゜ セ セ ョョョ セ セ セ セ ゜ セ セ セ セ セ セ ヤョ゜ セ セ ヤ ョ セ セ ヤョ セ セ ヤョ イ セ セ ヤョ セ セ ュュ セ ミ コッッョュョッョ セ セ ュュュュュュ ゜アアオーア゜カイアーカウアョアアクオキークウオイエキーュュ