Class: Workarea::SetShippingEstimationAddress

Inherits:
Object
  • Object
show all
Defined in:
app/services/workarea/set_shipping_estimation_address.rb

Instance Method Summary collapse

Constructor Details

#initialize(checkout, location, user = nil) ⇒ SetShippingEstimationAddress

Returns a new instance of SetShippingEstimationAddress.



5
6
7
8
9
# File 'app/services/workarea/set_shipping_estimation_address.rb', line 5

def initialize(checkout, location, user = nil)
  @checkout = checkout
  @location = location
  @user = user
end

Instance Method Details

#performObject



11
12
13
14
15
# File 'app/services/workarea/set_shipping_estimation_address.rb', line 11

def perform
  return if shipping.nil?
  set_address unless shipping.address.present?
  recalculate_price
end