On 4/2/07, Ken Mitchell <kmitchell / farmerswireless.com> wrote:
> I have what I feel should be a simple issue.  Look at the following:
>
> ############################
> # Test of nested modules/classes
> ############################
> class Global
>   module TestMod
>     TEST = "test1"
>     def print_test
>       puts "test2"
>     end
>   end#module TestMod
>
>   include TestMod

You only include the module, therefore any methods defined in it will
only be instance methods. By trying to call print_test from inside the
class definition you are calling it as a class method. If you want
print_test to also be a class method you must extend TestMod as well
as including it.

Basically include adds the module's methods as instance methods and
extend adds them as class methods.

Ryan