Method: ParamsReady::Helpers::KeyMap::Mapping#remap
- Defined in:
- lib/params_ready/helpers/key_map.rb
#remap(from, to, input, target) ⇒ Object
83 84 85 86 87 88 89 |
# File 'lib/params_ready/helpers/key_map.rb', line 83 def remap(from, to, input, target) path(from).names.each_with_index do |input_name, idx| value = dig(from, input_name, input) target_name = path(to).names[idx] store(to, target_name, value, target) end end |