Sha256: dc33d485596ce43f8b90d603b680369f70de9e7d7d2a98335404e88919052456
Contents?: true
Size: 332 Bytes
Versions: 31
Compression:
Stored size: 332 Bytes
Contents
def flatten_keys_to_joined_string(h, key_delim='::') flat = {} h.each_pair do |k, v| if v.respond_to?(:keys) flatten_keys_to_joined_string(v, key_delim).each_pair do |k2, v2| flat.merge!({[k.to_s, k2.to_s].join(key_delim) => v2}) end else flat.merge!({ k.to_s => v }) end end flat end
Version data entries
31 entries across 31 versions & 1 rubygems