From: Gene Tani Date: 2005-12-23T14:22:50+09:00 Subject: Re: Why not Python? (No, no, I am not a spy) dblack@wobblini.net wrote: > Hi -- > > On Fri, 23 Dec 2005, Brian Mitchell wrote: > > > On 12/22/05, J. Ryan Sobol wrote: > >> Excuse my newbi-ness, but isn't that "self rule" for class methods > >> similar in Ruby? E.g. > >> > >> class A > >> def self.a_class_method > >> puts "A class method" > >> end > >> # OR > >> def A.another_class_method > >> puts "Another class method" > >> end > >> end > > > > OR > > > > class A > > class << self > > def foo; end > > end > > end > > > > OR > > > > class A > > class << A > > def foo; end > > end > > end > > Also: > > class A > end > > and then: > > class << A > def foo; end > end > > or > > def A.foo > end > let's not forget def ClassName::clsmeth(params) end (either inside or outside class def, so that's 5 ways to do it inside class def, 3 outside for those keeping score at home, mostly python hyperenthusiasts