Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/bitly_oauth/lib/core_ext/hash.rb
Direct Known Subclasses
Instance Method Summary collapse
- #stringify_keys ⇒ Object
- #stringify_keys! ⇒ Object
- #symbolize_keys ⇒ Object
- #symbolize_keys! ⇒ Object
Instance Method Details
#stringify_keys ⇒ Object
9 10 11 |
# File 'lib/bitly_oauth/lib/core_ext/hash.rb', line 9 def stringify_keys dup.stringify_keys! end |
#stringify_keys! ⇒ Object
2 3 4 5 6 7 |
# File 'lib/bitly_oauth/lib/core_ext/hash.rb', line 2 def stringify_keys! keys.each do |key| self[key.to_s] = delete(key) end self end |
#symbolize_keys ⇒ Object
20 21 22 |
# File 'lib/bitly_oauth/lib/core_ext/hash.rb', line 20 def symbolize_keys dup.symbolize_keys! end |
#symbolize_keys! ⇒ Object
13 14 15 16 17 18 |
# File 'lib/bitly_oauth/lib/core_ext/hash.rb', line 13 def symbolize_keys! keys.each do |key| self[(key.to_sym rescue key) || key] = delete(key) end self end |