Class: CashRegister::Two4OneItem

Inherits:
NormalItem show all
Defined in:
lib/cash_register/two4one_item.rb

Instance Attribute Summary

Attributes inherited from NormalItem

#count, #deal

Instance Method Summary collapse

Methods inherited from NormalItem

#initialize, #to_s

Methods included from Helper

#format_price

Constructor Details

This class inherits a constructor from CashRegister::NormalItem

Instance Method Details

#billingObject



4
5
6
# File 'lib/cash_register/two4one_item.rb', line 4

def billing
  @billing ||= deal.price * (count - count/3)
end

#savingObject



8
9
10
# File 'lib/cash_register/two4one_item.rb', line 8

def saving
  @saving ||= deal.price * count - billing
end