Class: Hash
Instance Method Summary (collapse)
Instance Method Details
- (Object) symbolize_and_underscore_keys
320 321 322 323 324 325 |
# File 'lib/wordnik_ruby_helpers.rb', line 320 def symbolize_and_underscore_keys inject({}) do |, (key, value)| [(key.to_s.underscore.to_sym rescue key) || key] = value end end |
- (Object) symbolize_and_underscore_keys!
327 328 329 |
# File 'lib/wordnik_ruby_helpers.rb', line 327 def symbolize_and_underscore_keys! self.replace(self.symbolize_and_underscore_keys) end |