[ruby-talk:00331] module-class calling

From: "Michael Neumann" <neumann@...>
Date: 1999-05-22 09:14:50 UTC
List: ruby-talk #331
Hi...

Can I call a function of a module from a class-method?
Following example didn't work! Why?


module A
   def hello
      print "HELLO\n"
   end
end=20

class B
   def call_A
      include A  # error
      A.hello
   end
end

x =3D B.new
x.call_A


Thanks...
Michael

In This Thread

Prev Next