Module: Util
- Included in:
- RedisConnector
- Defined in:
- lib/redis_connector/util.rb
Instance Method Summary collapse
-
#stringify_keys(hash) ⇒ Hash
Stringifies the keys of the specified hash.
-
#symbolize_keys(hash) ⇒ Hash
Symbolizes the keys of the specified hash.
Instance Method Details
#stringify_keys(hash) ⇒ Hash
Stringifies the keys of the specified hash.
14 15 16 |
# File 'lib/redis_connector/util.rb', line 14 def stringify_keys(hash) Hash[hash.map { |k, v| [k.to_s, v] }] end |
#symbolize_keys(hash) ⇒ Hash
Symbolizes the keys of the specified hash.
6 7 8 |
# File 'lib/redis_connector/util.rb', line 6 def symbolize_keys(hash) Hash[hash.map { |k, v| [k.to_sym, v] }] end |