Hi,
I am wondering, why is an included module's methods mixed in to any subsequent class definitions (as if the class included it in itself)?
module Foo
def bar
print "#{self}\n"
end
end
class Bar
end
begin
Bar.bar
rescue NoMethodError
puts "There is no Bar.bar\n"
end
include Foo
bar
Bar.bar
Bar.new.bar
prints:
There is no Bar.bar main Bar #<Bar:0xb73f2048>
Is this the expected behavior? Why?