Hi,
My question is really simple 
class MyClass
ANYTHING = "huh"
end
How can I print out huh from string?
MyClass::"anything".upcase
Is there any way to do that ?

Thanks for help...
···
--
Posted via http://www.ruby-forum.com/.
Hi,
My question is really simple 
class MyClass
ANYTHING = "huh"
end
How can I print out huh from string?
MyClass::"anything".upcase
Is there any way to do that ?

Thanks for help...
--
Posted via http://www.ruby-forum.com/.
Jamal Soueidan wrote:
MyClass::"anything".upcase
Is there any way to do that ?
MyClass.const_get("anything".upcase)
HTH,
Sebastian
--
NP: Porcupine Tree - Shallow
Jabber: sepp2k@jabber.org
ICQ: 205544826
Sure, for example:
MyClass.module_eval("ANYTHING")
MyClass.const_get("ANYTHING")
In Rails you also have:
"MyClass::ANYTHING".constantize
-- fxn
On Nov 21, 2007, at 9:28 PM, Jamal Soueidan wrote:
class MyClass
ANYTHING = "huh"
endHow can I print out huh from string?
MyClass::"anything".upcase
Is there any way to do that ?
Thanks 
--
Posted via http://www.ruby-forum.com/.