lib/nds_api/utils.rb in nds_api-0.1.9 vs lib/nds_api/utils.rb in nds_api-0.1.11
- old
+ new
@@ -1,12 +1,10 @@
module NdsApi
module Utils
class << self
-
def hash_keys_str_to_sym(hash)
return hash unless hash.is_a? Hash
- hash.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
+ hash.each_with_object({}) { |(k, v), memo| memo[k.to_sym] = v; }
end
-
end
end
end