On Wed, Dec 12, 2012 at 12:40 PM, Ramon de C Valle <[email protected]> wrote:

> Thank you for the additional information! Any suggestions of a possible
> "more Ruby" way of doing this?

Keep the data in the Hash and use it there.  If you think about it you
will need eval for manipulation of the data as well because you do not
know beforehand what local variables you have, don't you?  If accesses
like hash[:a] are just inconvenient you could copy the Hash into an
OpenStruct and do hash.a which might be slightly nicer.

Generating local variables is almost always a bad idea.

Kind regards

robert


--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

-- You received this message because you are subscribed to the Google Groups 
ruby-talk-google group. To post to this group, send email to 
[email protected]. To unsubscribe from this group, send email 
to [email protected]. For more options, visit this 
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en

Reply via email to