Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/rzabbix.rb
Instance Method Summary collapse
Instance Method Details
#rzbx_recursively_symbolize_keys ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/rzabbix.rb', line 22 def rzbx_recursively_symbolize_keys result = self.rzbx_symbolize_keys result.keys.each do |key| if result[key].is_a?(Hash) || result[key].is_a?(Array) result[key] = result[key].rzbx_recursively_symbolize_keys end end result end |
#rzbx_symbolize_keys ⇒ Object
14 15 16 17 18 19 |
# File 'lib/rzabbix.rb', line 14 def rzbx_symbolize_keys inject({}) do |, (key, value)| [(key.to_sym rescue key) || key] = value end end |