Module: SolidusFriendlyPromotions::DiscountableAmount

Defined in:
app/models/concerns/solidus_friendly_promotions/discountable_amount.rb

Instance Method Summary collapse

Instance Method Details

#current_discountsObject



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_amountObject



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_discountsObject



17
18
19
# File 'app/models/concerns/solidus_friendly_promotions/discountable_amount.rb', line 17

def reset_current_discounts
  @current_discounts = []
end