This is a multi-part message in MIME format.

------extPart_000_0007_01BEA444.4F6B0E20
Content-Type: text/plain;
	charsetso-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 

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

x = B.new
x.call_A


Thanks...
Michael


------extPart_000_0007_01BEA444.4F6B0E20
Content-Type: text/html;
	charsetso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2014.210" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Can I call a function of a module from a 
class-method?</FONT></DIV>
<DIV><FONT face=Arial size=2>Following example didn't work! Why?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>module A<BR>&nbsp;&nbsp; def 
hello<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print "HELLO\n"<BR>&nbsp;&nbsp; 
end<BR>end </FONT></DIV>
<DIV><FONT face=Arial size=2><BR>class B<BR>&nbsp;&nbsp; def 
call_A<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; include A&nbsp;&nbsp;# 
error<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; A.hello<BR>&nbsp;&nbsp; 
end<BR>end</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>x = B.new<BR>x.call_A<BR></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks...</FONT></DIV>
<DIV><FONT face=Arial size=2>Michael</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;</DIV></FONT></BODY></HTML>

------extPart_000_0007_01BEA444.4F6B0E20--