Module: MappedAttributes
- Defined in:
- lib/mapped_attributes.rb,
lib/mapped_attributes/version.rb
Constant Summary collapse
- VERSION =
"1.0.0"
Instance Method Summary collapse
Instance Method Details
#get_unmapped_attributes ⇒ Object
10 11 12 |
# File 'lib/mapped_attributes.rb', line 10 def get_unmapped_attributes @unused_data_fields || [] end |
#set_mapped_attributes(data, opts = {}) ⇒ Object
4 5 6 7 8 |
# File 'lib/mapped_attributes.rb', line 4 def set_mapped_attributes(data, opts = {}) @unused_data_fields = data.keys mapping = get_attributes_mapping(opts[:as] || self.class.name.underscore) self.attributes = get_mapped_attributes(data, mapping) end |