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?, calculators, description, #description, #to_s

Methods inherited from Base

display_includes, #initialize_preference_defaults, page, preference

Methods included from Preferences::Preferable

#default_preferences, #defined_preferences, #get_preference, #has_preference!, #has_preference?, #preference_default, #preference_type, #set_preference

Instance Method Details

#compute(object) ⇒ Object



6
7
8
# File 'app/models/spree/calculator/percent_on_line_item.rb', line 6

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