lib/rocket_chat/util.rb in rocketchat-0.1.7 vs lib/rocket_chat/util.rb in rocketchat-0.1.8
- old
+ new
@@ -8,10 +8,17 @@
# @param [Hash] hash A string/symbol keyed hash
# @return Stringified hash
#
def stringify_hash_keys(hash)
new_hash = {}
- hash.each { |key, value| new_hash[key.to_s] = value }
+ hash.each do |key, value|
+ new_hash[key.to_s] =
+ if value.is_a? Hash
+ stringify_hash_keys value
+ else
+ value
+ end
+ end
new_hash
end
module_function :stringify_hash_keys
#