Class: ShoppingCart::CheckoutAddresser

Inherits:
Object
  • Object
show all
Defined in:
app/services/shopping_cart/checkout_addresser.rb

Instance Method Summary collapse

Constructor Details

#initialize(params:, type:) ⇒ CheckoutAddresser

Returns a new instance of CheckoutAddresser.



3
4
5
6
# File 'app/services/shopping_cart/checkout_addresser.rb', line 3

def initialize(params:, type:)
  @params = params
  @type = type
end

Instance Method Details

#callObject



8
9
10
11
12
# File 'app/services/shopping_cart/checkout_addresser.rb', line 8

def call
  address = find_address || new_address
  address.attributes = address_params
  address
end