A wrapper for Hash that lets you access keys via dynamic methods (like Ruby's OpenStruct) but also:
- works recursively
- also lets you use Hash methods like
[]
andkeys
hash = Superhash.new({ foo: "bar", other: { "fizz" => "buzz" } })
hash.foo #=> "bar"
hash.other.fizz #=> "buzz"
hash[:foo] #=> "bar"
hash["foo"] #=> "bar"
hash.keys #=> ["foo", "other"]
hash.other #=> #<Superhash:0x007fd841848c28>
hash.other.hash #=> {"fizz"=>"buzz"}