module MadCart::AttributeMapper::ClassMethods

Public Instance Methods

map_attribute_name(name) click to toggle source
# 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() click to toggle source
# File lib/mad_cart/attribute_mapper.rb, line 25
def mapped_attributes
  mapping_hash.values
end
mapping_hash() click to toggle source
# 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() click to toggle source
# File lib/mad_cart/attribute_mapper.rb, line 29
def unmapped_attributes
  mapping_hash.keys
end