From: Andrew Wagner Date: 2010-08-10T05:36:15+09:00 Subject: Re: modules --0003255554c2ad5fef048d69f745 Content-Type: text/plain; charset=UTF-8 Modules in ruby have a lot of similarities to classes (in fact, Class inherits from Module). Anyway, for this reason, it should make sense that you want to define "self.yo" instead of just "yo", because it's a module-level method, not some sort of instance method. Once you do that, to use the module as a scope, you use two colons. So, the correct code is: module Test def self.yo puts 'yo' end end Test::yo #=> yo On Mon, Aug 9, 2010 at 4:23 PM, Mickael Faivre-Macon wrote: > Hi, > > I don't understand how to use modules. > Could someone explain this to me please ? > > module Test > def yo > puts 'yo' > end > end > > Test.yo # undefined method `yo' for Test:Module > > Mickael. > -- > Posted via http://www.ruby-forum.com/. > > --0003255554c2ad5fef048d69f745--