From: Brian Mitchell Date: 2005-12-23T13:22:10+09:00 Subject: Re: Why not Python? (No, no, I am not a spy) 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 All equivalent in function definition (though surrounding scope can differ inside class << declarations). It is similar but remember that self is the class not an instance of the class. Brian.