Class: ShoppingCart::CheckoutAddresser
- Inherits:
-
Object
- Object
- ShoppingCart::CheckoutAddresser
- Defined in:
- app/services/shopping_cart/checkout_addresser.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(params:, type:) ⇒ CheckoutAddresser
constructor
A new instance of CheckoutAddresser.
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
#call ⇒ Object
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 |