Sha256: 06335c73b7e3f4e0841a0ada38a1629b011de473f82d444fede6d87776717b96

Contents?: true

Size: 244 Bytes

Versions: 1

Compression:

Stored size: 244 Bytes

Contents

class PaymentCalculator::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

1 entries across 1 versions & 1 rubygems

Version Path
spree_payment_calculator-0.70.1 app/model/payment_calculator/per_item.rb