Class: Spree::Calculator::PercentOnLineItem

Inherits:
Spree::Calculator show all
Defined in:
core/app/models/spree/calculator/percent_on_line_item.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) ⇒ Object



9
10
11
# File 'core/app/models/spree/calculator/percent_on_line_item.rb', line 9

def compute(object)
  (object.amount * preferred_percent) / 100
end