Huw Collingbourne
4/28/2006 10:04:00 AM
"aidy" <aidy.rutter@gmail.com> wrote in message
news:1146213629.494962.42540@j73g2000cwa.googlegroups.com...
> If Ruby is object-oriented why can I create a method outside of a class
> and why can I implement methods in modules?
The answer is that you can't make a method outside of a class. In Ruby a
module is an instance of the class Module. Moreover, when you create a
program, a main Object is automatically created to contain your methods.
Try running this:
puts( self )
puts( self.class )
best wishes
Huw Collingbourne
================================
Bitwise Magazine
www.bitwisemag.com
Dark Neon Ltd.
================================