Class: Hash

Inherits:
Object show all
Defined in:
lib/ext/hash_to_openstruct.rb

Instance Method Summary collapse

Instance Method Details

#to_openstructObject



5
6
7
8
9
# File 'lib/ext/hash_to_openstruct.rb', line 5

def to_openstruct
  mapped = {}
  each{ |key,value| mapped[key] = value.to_openstruct }
  OpenStruct.new(mapped)
end