Method: ConfigMapper::Mapper#configure_with
- Defined in:
- lib/config_mapper/mapper.rb
#configure_with(data) ⇒ Hash
Map configuration data onto the target.
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/config_mapper/mapper.rb', line 13 def configure_with(data) errors = {} if data.respond_to?(:each_pair) data.each_pair do |key, value| configure_attribute(key, value, errors) end else data.each_with_index do |value, index| configure_attribute(index, value, errors) end end errors end |