Class: ConfigMapper::Mapper
- Inherits:
-
Object
- Object
- ConfigMapper::Mapper
- Defined in:
- lib/config_mapper/mapper.rb
Overview
Something that accepts configuration.
Direct Known Subclasses
Instance Method Summary collapse
-
#configure_with(data) ⇒ Hash
Map configuration data onto the target.
Instance Method Details
#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 |