Recursively Setting Deep Hash Value
I’ve always wanted to be able to do something like:
So I whipped up this small code and now I can! Metaprogramming wins again!
my_hash = {}
my_hash["Cloud"]["Stats"]["Strength"] = 100
p my_hash # => {"Cloud"=>{"Stats"=>{"Strength"=>100}}}
So I whipped up this small code and now I can! Metaprogramming wins again!

Comments