Class: Calculator::FreeShipping
- Inherits:
-
Calculator
- Object
- Calculator
- Calculator::FreeShipping
- Defined in:
- app/models/calculator/free_shipping.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.description ⇒ Object
3 4 5 |
# File 'app/models/calculator/free_shipping.rb', line 3 def self.description I18n.t("free_shipping") end |
.register ⇒ Object
7 8 9 10 |
# File 'app/models/calculator/free_shipping.rb', line 7 def self.register super Promotion.register_calculator(self) end |
Instance Method Details
#compute(object) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'app/models/calculator/free_shipping.rb', line 12 def compute(object) if object.is_a?(Array) return if object.empty? order = object.first.order else order = object end order.ship_total end |