Module: Useful::RubyExtensions::Hash::FromActivesupport::InstanceMethods
- Defined in:
- lib/useful/ruby_extensions/hash.rb
Instance Method Summary collapse
-
#stringify_keys ⇒ Object
Return a new hash with all keys converted to strings.
-
#stringify_keys! ⇒ Object
Destructively convert all keys to strings.
-
#symbolize_keys ⇒ Object
Return a new hash with all keys converted to strings.
-
#symbolize_keys! ⇒ Object
Destructively convert all keys to strings.
Instance Method Details
#stringify_keys ⇒ Object
Return a new hash with all keys converted to strings.
145 146 147 |
# File 'lib/useful/ruby_extensions/hash.rb', line 145 def stringify_keys self.class.stringify_keys(self.dup) end |
#stringify_keys! ⇒ Object
Destructively convert all keys to strings.
149 150 151 |
# File 'lib/useful/ruby_extensions/hash.rb', line 149 def stringify_keys! self.class.stringify_keys(self) end |
#symbolize_keys ⇒ Object
Return a new hash with all keys converted to strings.
154 155 156 |
# File 'lib/useful/ruby_extensions/hash.rb', line 154 def symbolize_keys self.class.symbolize_keys(self.dup) end |
#symbolize_keys! ⇒ Object
Destructively convert all keys to strings.
158 159 160 |
# File 'lib/useful/ruby_extensions/hash.rb', line 158 def symbolize_keys! self.class.symbolize_keys(self) end |