Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/awspec/ext/hash.rb
Instance Method Summary collapse
Instance Method Details
#to_struct ⇒ Object
2 3 4 5 6 7 8 9 |
# File 'lib/awspec/ext/hash.rb', line 2 def to_struct st = Struct.new(*self.keys) maps = self.values.map do |s| next s.to_struct if s.is_a?(Hash) s end st.new(*maps) end |