Class: Spree::Calculator::FlatRate

Inherits:
Spree::Calculator show all
Defined in:
core/app/models/spree/calculator/flat_rate.rb

Instance Method Summary collapse

Methods inherited from Spree::Calculator

#available?, calculators, description, #description, #to_s

Methods inherited from Base

display_includes, #initialize_preference_defaults, page, preference

Instance Method Details

#compute(object = nil) ⇒ Object



10
11
12
13
14
15
16
# File 'core/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