Friday, March 21, 2008

Hash to Class

I ran into this looking for Ruby Charts. This is a brilliant bit of code to convert a Hash into a class object. Essentially it converts the keys into members containing the hash values. It also converts the object back into a hash.

http://pullmonkey.com/2008/1/6/convert-a-ruby-hash-into-a-class-object

Thanks to Charlie at Pull Monkey

No comments: