class Hash

Public Instance Methods

purify_hash() click to toggle source
# File lib/ssource/source_kitten.rb, line 5
def purify_hash
  hash = transform_keys do |key|
    return value unless key.start_with? 'key.'
    key[4..-1]
  end
  substructure = hash['substructure']
  return hash unless substructure
  hash['substructure'] = substructure.map(&:purify_hash)
  hash
end