Sha256: cf04faef266e3dac8a67e22218a5e9849cd600a10996f0ab3cf5af40f575be2f

Contents?: true

Size: 238 Bytes

Versions: 8

Compression:

Stored size: 238 Bytes

Contents

class Calculator::PerItem < Calculator
  preference :amount, :decimal, :default => 0

  def self.description
    I18n.t("flat_rate_per_item")
  end

  def compute(object=nil)
    self.preferred_amount * object.line_items.length
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
spree_core-0.70.7 app/models/calculator/per_item.rb
spree_core-0.70.6 app/models/calculator/per_item.rb
spree_core-0.70.5 app/models/calculator/per_item.rb
spree_core-0.70.4 app/models/calculator/per_item.rb
spree_core-0.70.3 app/models/calculator/per_item.rb
spree_core-0.70.2 app/models/calculator/per_item.rb
spree_core-0.70.1 app/models/calculator/per_item.rb
spree_core-0.70.0 app/models/calculator/per_item.rb