Module: SolidusFriendlyPromotions::DiscountableAmount
- Defined in:
- app/models/concerns/solidus_friendly_promotions/discountable_amount.rb
Instance Method Summary collapse
- #current_discounts ⇒ Object
- #current_discounts=(args) ⇒ Object
- #discountable_amount ⇒ Object
- #reset_current_discounts ⇒ Object
Instance Method Details
#current_discounts ⇒ Object
9 10 11 |
# File 'app/models/concerns/solidus_friendly_promotions/discountable_amount.rb', line 9 def current_discounts @current_discounts ||= [] end |
#current_discounts=(args) ⇒ Object
13 14 15 |
# File 'app/models/concerns/solidus_friendly_promotions/discountable_amount.rb', line 13 def current_discounts=(args) @current_discounts = args end |
#discountable_amount ⇒ Object
5 6 7 |
# File 'app/models/concerns/solidus_friendly_promotions/discountable_amount.rb', line 5 def discountable_amount amount + current_discounts.sum(&:amount) end |
#reset_current_discounts ⇒ Object
17 18 19 |
# File 'app/models/concerns/solidus_friendly_promotions/discountable_amount.rb', line 17 def reset_current_discounts @current_discounts = [] end |