From: Abder-Rahman Ali on 14 Jul 2010 10:45 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 14 Jul 2010 11:21 [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 21 Jul 2010 04:45 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/.
First
|
Prev
|
Pages: 1 2 Prev: This script is a bit confusing! Next: click a javascript dialog window in Firefox |