Class: Calculator::FixedAmountSalePriceCalculator

Inherits:
Spree::Calculator
  • Object
show all
Defined in:
app/models/spree/calculator/fixed_amount_sale_price_calculator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.descriptionObject

TODO validate that the sale price is less than the original price



4
5
6
# File 'app/models/spree/calculator/fixed_amount_sale_price_calculator.rb', line 4

def self.description
  "Calculates the sale price for a Variant by returning the provided fixed sale price"
end

Instance Method Details

#compute(sale_price) ⇒ Object



8
9
10
# File 'app/models/spree/calculator/fixed_amount_sale_price_calculator.rb', line 8

def compute(sale_price)
  sale_price.value
end