<arturaz> any ideas how i can get @foo from :foo ?
<inono> magic
<TeflonTed> eval "@#{:foo.to_s}" ? :-)
<arturaz> eval's evil :)
<TeflonTed> magic is evil
Sunday, August 6
Subscribe to:
Post Comments (Atom)
Divorced Java after 12 years of misery. Eloped with Ruby and never been happier.
2 comments:
If you have attr_readers defined you can just do (from within the instance)
send(:foo)
Object#instance_variable_get
Object#instance_variable_set
Post a Comment