Sha256: 127c73cba795001559bb60176fe89b4d22849266830fb0f81500f7049906f698
Contents?: true
Size: 320 Bytes
Versions: 30
Compression:
Stored size: 320 Bytes
Contents
class Calculator::PerItem < Calculator preference :amount, :decimal, :default => 0 def self.description I18n.t("flat_rate_per_item") end def self.register super ShippingMethod.register_calculator(self) end def compute(object=nil) self.preferred_amount * object.line_items.length end end
Version data entries
30 entries across 30 versions & 6 rubygems