Class: ShippingCostCalculator
- Inherits:
-
Object
- Object
- ShippingCostCalculator
- Defined in:
- app/models/shipping_cost_calculator.rb
Instance Method Summary collapse
-
#initialize(order) ⇒ ShippingCostCalculator
constructor
A new instance of ShippingCostCalculator.
- #shipping_cost ⇒ Object
Constructor Details
#initialize(order) ⇒ ShippingCostCalculator
Returns a new instance of ShippingCostCalculator.
2 3 4 |
# File 'app/models/shipping_cost_calculator.rb', line 2 def initialize(order) @order = order end |
Instance Method Details
#shipping_cost ⇒ Object
6 7 8 |
# File 'app/models/shipping_cost_calculator.rb', line 6 def shipping_cost @order.shipping_method.try(:shipping_cost) || 0.0 end |