From: Brad Phelan Date: 2007-05-04T23:35:06+09:00 Subject: Re: modules and class methods. Brad Phelan wrote: > Why does this not work! > > ######################################## > module Foo > def self.foo a > puts a > end > end > > class Bar > include Foo > foo "hello" > end > > foo.rb:20: undefined method `foo' for Bar:Class (NoMethodError) > #################################### > > but this does > > class Bar > def self.foo a > puts a > end > foo "hello" > end > > > > What am I misunderstanding about modules???? > > -- > Brad > http://xtargets.com The below code obviously work the way I wish module Foo def foo puts "a" end end class Bar extend Foo puts foo end however is there any way to get the same effect by using include. I would like to mix in class and instance methods in one call. It seems I can do one or the other but not both at the same time. Is that correct? -- Brad Phelan http://xtargets.com