Class: RecursiveOpenStruct
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- RecursiveOpenStruct
- Defined in:
- lib/clean_config/ext/recursive_open_struct.rb
Overview
Monkeypatching RecursiveOpenStruct to respond to common Hash methods
Instance Method Summary collapse
-
#fetch(key, default = nil) ⇒ Object
Returns value for given key.
-
#keys ⇒ Array
Returns array with keys from the RecursiveOpenStruct.
Instance Method Details
#fetch(key, default = nil) ⇒ Object
Returns value for given key
13 14 15 |
# File 'lib/clean_config/ext/recursive_open_struct.rb', line 13 def fetch(key, default = nil) to_h.fetch(key, default) end |
#keys ⇒ Array
Returns array with keys from the RecursiveOpenStruct
5 6 7 |
# File 'lib/clean_config/ext/recursive_open_struct.rb', line 5 def keys to_h.keys end |