Class: Hash
Overview
:nodoc:
Instance Method Summary collapse
Instance Method Details
#symbolize_keys_and_values ⇒ Object
87 88 89 90 91 92 93 94 |
# File 'lib/sbn/helpers.rb', line 87 def symbolize_keys_and_values inject({}) do |, (key, value)| key = key.to_underscore_sym value = value.to_underscore_sym [key] = value end end |
#symbolize_keys_and_values! ⇒ Object
96 97 98 99 100 101 102 103 |
# File 'lib/sbn/helpers.rb', line 96 def symbolize_keys_and_values! keys.each do |key| newkey = key.to_underscore_sym self[newkey] = self[key].to_underscore_sym delete(key) unless key == newkey end self end |