From: Brian Candler Date: 2008-10-12T00:28:01+09:00 Subject: Re: Help me to better understand modules Zouplaz wrote: > I've noticed that, with the self. version I need to prefix them > with the module's name, so having namespacing which tends to make the > code more readable. That's right - you are explicitly calling a method which belongs to the module itself, not to any object which mixes in the module. > module Payment > def self.method_payment > end > end > > class AClass > include Payment > > def go > Payment.method_payment() > end > end You do not need "include Payment" in class AClass. You can call Payment.method_payment from anywhere. The module "Payment" itself is the receiver of the method. You only need "include Payment" if you want to mix in *instance methods* (those which are defined in the module without "self") - they then become instance methods of class AClass. Regards, Brian. -- Posted via http://www.ruby-forum.com/.