== DESCRIPTION:
hash-to-ostruct recursively transforms Hash to OpenStruct
It supports:
- hash of hashes
- hash of arrays with hashes as elements
== SYNOPSIS:
# Example One: Hash of hashes
require 'hash-to-ostruct'
countries_hash = {}
countries_hash[:australia] = { :capital => 'Canberra', :currency_code => 'AUD' }
countries_hash[:england] = { :capital => 'London', :currency_code => 'GBP' }
countries = countries_hash.to_ostruct
countries.australia.capital # returns "Canberra"
countries.australia.currency_code # returns "AUD"
countries.england.capital # returns "London"
countries.england.currency_code # returns "GBP"
== INSTALL:
sudo gem install hash-to-ostruct
Copyright (c) 2009 Kunal Parikh (mailto:kunal@techthumb.in)