Method: Dry::Schema::KeyMap#write

Defined in:
lib/dry/schema/key_map.rb

#write(source, target = EMPTY_HASH.dup) ⇒ Hash

Write a new hash based on the source hash

Parameters:

  • source (Hash)

    The source hash

  • target (Hash) (defaults to: EMPTY_HASH.dup)

    The target hash

Returns:

  • (Hash)


77
78
79
80
# File 'lib/dry/schema/key_map.rb', line 77

def write(source, target = EMPTY_HASH.dup)
  each { |key| key.write(source, target) }
  target
end