From: Abder-Rahman Ali on
A small thing here:

When I type:

puts MyModule::GOODMOODE

In the purpose of accessing a module's constant, I get the following:

uninitialized constant MyModule::GOODMOODE (NameError)

Although having the include.

How can I access a module's constant.

And, when reading about modules, the resources I saw so far mention that
modules includes:

1- Constants.
2- Methods.
3- Classes.

Don't they include variables?!

Thanks.

--
Posted via http://www.ruby-forum.com/.

From: skim on
[Note: parts of this message were removed to make it a legal post.]

In your private pastie, you have GOODMOOD, not GOODMOODE. I think this
could be why. Accessing MyModule::GOODMOOD worked.

On Wed, Jul 14, 2010 at 09:45, Abder-Rahman Ali
<abder.rahman.ali(a)gmail.com>wrote:

> A small thing here:
>
> When I type:
>
> puts MyModule::GOODMOODE
>
> In the purpose of accessing a module's constant, I get the following:
>
> uninitialized constant MyModule::GOODMOODE (NameError)
>
> Although having the include.
>
> How can I access a module's constant.
>
> And, when reading about modules, the resources I saw so far mention that
> modules includes:
>
> 1- Constants.
> 2- Methods.
> 3- Classes.
>
> Don't they include variables?!
>
> Thanks.
>
> --
> Posted via http://www.ruby-forum.com/.
>
>

From: Abder-Rahman Ali on
Steve Kim wrote:
> In your private pastie, you have GOODMOOD, not GOODMOODE. I think this
> could be why. Accessing MyModule::GOODMOOD worked.
>
> On Wed, Jul 14, 2010 at 09:45, Abder-Rahman Ali

Thanks everyone for your replies.
--
Posted via http://www.ruby-forum.com/.