Module: Spree::CalculatedAdjustments

Extended by:
ActiveSupport::Concern
Included in:
Promotion::Actions::CreateAdjustment, Promotion::Actions::CreateItemAdjustments, ShippingMethod, TaxRate
Defined in:
app/models/concerns/spree/calculated_adjustments.rb

Instance Method Summary collapse

Instance Method Details

#calculator_typeObject



27
28
29
# File 'app/models/concerns/spree/calculated_adjustments.rb', line 27

def calculator_type
  calculator.class.to_s if calculator
end

#calculator_type=(calculator_type) ⇒ Object



31
32
33
34
# File 'app/models/concerns/spree/calculated_adjustments.rb', line 31

def calculator_type=(calculator_type)
  klass = calculator_type.constantize if calculator_type
  self.calculator = klass.new if klass && !calculator.is_a?(klass)
end