From: Dhruva Sagar Date: 2010-12-07T21:09:34+09:00 Subject: Re: Module with classes --000e0cd28de00efeaa0496d0e099 Content-Type: text/plain; charset=UTF-8 You need to read a bit more on how modules work. Just to throw some light on your code, if you did a mister_man.crawl, it will result in printint out "I'm so slowwww!" The methods run & walk are defined in a separate class called Module1_Class, they will not be available with the Man class instances. Man::Module1_Class however is available since the included module adds that to Man. Hopefully this should guide you in the right direction. -- Thanks & Regards, Dhruva Sagar. On Tue, Dec 7, 2010 at 17:31, Durga B. wrote: > I read some materials about modules that is modules are combination of > classes and modules so i made a example but it gives error"undefined > method `run' for # (NoMethodError)" .I want call run > method in Module1_Class in Module1,is it possible i call run method > using Man class object. > > module Module1 > class Module1_Class > def run > puts "I'm running! in Module1" > end > def walk > puts "I'm walking a bit briskly!" > end > end > def crawl > puts "I'm so slowwww!" > end > > end > > class Man > include Module1 > def jump > puts "I'm bipedal and I can jump like a fool!" > end > end > mister_man = Man.new > mister_man.run > > -- > Posted via http://www.ruby-forum.com/. > > --000e0cd28de00efeaa0496d0e099--