Class: OpenStruct
- Inherits:
-
Object
- Object
- OpenStruct
- Defined in:
- lib/mkit/config/initializers/002_openstruct.rb
Instance Method Summary collapse
Instance Method Details
#to_hash ⇒ Object
2 3 4 5 6 |
# File 'lib/mkit/config/initializers/002_openstruct.rb', line 2 def to_hash self.each_pair.with_object({}) do |(key, value), hash| hash[key] = value.is_a?(OpenStruct) ? value.to_hash : value end end |