Module: Colppy::Utils
- Included in:
- Invoice::Item, Invoice::Payment, Invoice::TaxTotal, Resource
- Defined in:
- lib/colppy/utils.rb
Constant Summary collapse
- ATTRIBUTES_MAPPER =
{}
- DATA_KEYS_SETTERS =
[]
Class Method Summary collapse
Class Method Details
.rename_params_hash(params, mapper, setter) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/colppy/utils.rb', line 8 def rename_params_hash(params, mapper, setter) params.each_with_object({}) do |(key, value), hash| if new_key = mapper[key] hash[new_key] = value elsif setter.include?(key) hash[key] = value else hash[:unhandle] ||= {} hash[:unhandle][key] = value end end end |