Sha256: e7aceb070eb6b944d47ae38afe23ad2317390f0c5054176c2986938e3e09bc18
Contents?: true
Size: 597 Bytes
Versions: 17
Compression:
Stored size: 597 Bytes
Contents
# encoding: utf-8 # This file is distributed under Ting Yun's license terms. module TingYun module Support module HashExtensions module_function # recurses through hashes and arrays and stringifies keys def stringify_keys_in_object(object) case object when Hash object.inject({}) do |memo, (k, v)| memo[k.to_s] = stringify_keys_in_object(v) memo end when Array object.map {|o| stringify_keys_in_object(o)} else object end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems