Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/extlib_lite/core_extensions/hash.rb
Instance Method Summary collapse
-
#stringify ⇒ Object
Convert all keys to strings and deeply converts all values to strings Useful for creating a query string.
Instance Method Details
#stringify ⇒ Object
Convert all keys to strings and deeply converts all values to strings Useful for creating a query string
20 21 22 23 24 25 26 27 28 |
# File 'lib/extlib_lite/core_extensions/hash.rb', line 20 def stringify stringified_hash = {} each do |key, value| value.is_a?(Hash) ? stringified_hash[key.to_s] = value.stringify : stringified_hash[key.to_s] = value.to_s end stringified_hash end |