From: "Jesús Gabriel y Galán" Date: 2008-11-19T19:52:33+09:00 Subject: Re: Run a method in a Module On Wed, Nov 19, 2008 at 11:40 AM, Mario Ruiz wrote: > Hi, > I have two different modules that contain a few methods with the same > name so I cannot include the modules in the code and I need to do > something like: > > module Module1 > def myMethod > puts "hi" > end > def others > end > end > > module Module2 > def myMethod > puts "more hi" > end > end > > a=MyModule1.myMethod > b=MyModule2.myMethod > > But it's not working, the error is: undefined method 'myMethod' > > any idea?? If you want to call a method from a Module that's not supposed to be part of the instance of a class, then you can try this: module Module1 def self.myMethod puts "hi" end def others end end irb(main):020:0> Module1.myMethod hi Jesus.