Module: MadCart::AttributeMapper::ClassMethods
- Defined in:
- lib/mad_cart/attribute_mapper.rb
Instance Method Summary collapse
- #map_attribute_name(name) ⇒ Object
- #mapped_attributes ⇒ Object
- #mapping_hash ⇒ Object
- #unmapped_attributes ⇒ Object
Instance Method Details
#map_attribute_name(name) ⇒ Object
17 18 19 |
# File 'lib/mad_cart/attribute_mapper.rb', line 17 def map_attribute_name(name) mapping_hash[name.to_sym] || mapping_hash[name.to_s] || name end |
#mapped_attributes ⇒ Object
25 26 27 |
# File 'lib/mad_cart/attribute_mapper.rb', line 25 def mapped_attributes mapping_hash.values end |
#mapping_hash ⇒ Object
21 22 23 |
# File 'lib/mad_cart/attribute_mapper.rb', line 21 def mapping_hash MadCart.config.attribute_maps[self.to_s.demodulize.underscore.pluralize] || {} end |
#unmapped_attributes ⇒ Object
29 30 31 |
# File 'lib/mad_cart/attribute_mapper.rb', line 29 def unmapped_attributes mapping_hash.keys end |