Class: Spree::Calculator::FlatRate
- Inherits:
-
Spree::Calculator
- Object
- ActiveRecord::Base
- Base
- Spree::Calculator
- Spree::Calculator::FlatRate
- Defined in:
- app/models/spree/calculator/flat_rate.rb
Instance Method Summary collapse
Methods inherited from Spree::Calculator
#available?, #description, description, #to_s
Methods inherited from Base
Methods included from Spree::Core::Permalinks
#generate_permalink, #save_permalink
Instance Method Details
#compute(object = nil) ⇒ Object
10 11 12 13 14 15 16 |
# File 'app/models/spree/calculator/flat_rate.rb', line 10 def compute(object = nil) if object && preferred_currency.casecmp(object.currency).zero? preferred_amount else 0 end end |