Sha256: 00fe02b04453b0536cf8992cddfd54c1700da640362e6a86b2c717a8becc8141

Contents?: true

Size: 366 Bytes

Versions: 23

Compression:

Stored size: 366 Bytes

Contents

class Calculator::FreeShipping < ::Calculator

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

  def self.register
    super
    Promotion.register_calculator(self)
  end

  def compute(object)
    if object.is_a?(Array)
      return if object.empty?
      order = object.first.order
    else
      order = object
    end

    order.ship_total
  end

end

Version data entries

23 entries across 23 versions & 7 rubygems

Version Path
apispree_promo-0.0.0 app/models/calculator/free_shipping.rb
My-Commerce_promo-1.1.0 app/models/calculator/free_shipping.rb
My-Commerce_promo-1.0.0 app/models/calculator/free_shipping.rb
MyCommerceapi-1.0.0 promo/app/models/calculator/free_shipping.rb
MyCommerce-0.0.3 promo/app/models/calculator/free_shipping.rb
rfcommerce_promo-0.0.3 app/models/calculator/free_shipping.rb
spree_promo-0.60.6 app/models/calculator/free_shipping.rb
spree_promo-0.60.5 app/models/calculator/free_shipping.rb
spree_promo-0.50.4 app/models/calculator/free_shipping.rb
spree_promo-0.60.4 app/models/calculator/free_shipping.rb
spree_promo-0.50.3 app/models/calculator/free_shipping.rb
spree_promo-0.60.3 app/models/calculator/free_shipping.rb
spree_promo-0.60.2 app/models/calculator/free_shipping.rb
spree_promo-0.70.0.rc2 app/models/calculator/free_shipping.rb
spree_promo-0.70.RC1 app/models/calculator/free_shipping.rb
spree_bushido_promo-0.80.28 app/models/calculator/free_shipping.rb
spree_bushido_promo-0.80.27 app/models/calculator/free_shipping.rb
spree_promo-0.60.1 app/models/calculator/free_shipping.rb
spree_promo-0.60.0 app/models/calculator/free_shipping.rb
spree_promo-0.60.0.RC1 app/models/calculator/free_shipping.rb