Class: ShippingCostCalculator

Inherits:
Object
  • Object
show all
Defined in:
app/models/shipping_cost_calculator.rb

Instance Method Summary collapse

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_costObject



6
7
8
# File 'app/models/shipping_cost_calculator.rb', line 6

def shipping_cost
  @order.shipping_method.try(:shipping_cost) || 0.0
end