Class: Spree::Calculator::PercentOnLineItem

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

Instance Method Summary collapse

Methods inherited from Spree::Calculator

#available?, #description, description, #to_s

Methods inherited from Base

display_includes

Methods included from Spree::Core::Permalinks

#generate_permalink, #save_permalink

Instance Method Details

#compute(object) ⇒ Object



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

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