From: Michael Neumann Date: 1999-05-22T11:14:50+02:00 Subject: [ruby-talk:00331] module-class calling This is a multi-part message in MIME format. ------=_NextPart_000_0007_01BEA444.4F6B0E20 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 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 ------=_NextPart_000_0007_01BEA444.4F6B0E20 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi...
 
Can I call a function of a module from = a=20 class-method?
Following example didn't work! = Why?
 
 
module A
   def=20 hello
      print "HELLO\n"
  =20 end
end

class B
   def=20 call_A
      include A  #=20 error
      A.hello
  =20 end
end
 
x =3D = B.new
x.call_A
 
Thanks...
Michael
 
------=_NextPart_000_0007_01BEA444.4F6B0E20--