class Effective::CartItem
def name
def name purchasable&.purchasable_name end
def price
def price if (purchasable.price || 0).kind_of?(Integer) purchasable.price || 0 else raise 'expected price to be an Integer representing the number of cents.' end end
def subtotal
def subtotal price * quantity end
def tax_exempt
def tax_exempt purchasable&.tax_exempt || false end
def to_s
def to_s name || 'New Cart Item' end