Class: SolidusBolt::Accounts::AddAddressService

Inherits:
BaseService
  • Object
show all
Defined in:
app/services/solidus_bolt/accounts/add_address_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseService

call

Constructor Details

#initialize(order:, address:, access_token:) ⇒ AddAddressService

Returns a new instance of AddAddressService.



8
9
10
11
12
13
# File 'app/services/solidus_bolt/accounts/add_address_service.rb', line 8

def initialize(order:, address:, access_token:)
  @order = order
  @address = address
  @access_token = access_token
  super
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



6
7
8
# File 'app/services/solidus_bolt/accounts/add_address_service.rb', line 6

def access_token
  @access_token
end

#addressObject (readonly)

Returns the value of attribute address.



6
7
8
# File 'app/services/solidus_bolt/accounts/add_address_service.rb', line 6

def address
  @address
end

#orderObject (readonly)

Returns the value of attribute order.



6
7
8
# File 'app/services/solidus_bolt/accounts/add_address_service.rb', line 6

def order
  @order
end

Instance Method Details

#callObject



15
16
17
18
19
# File 'app/services/solidus_bolt/accounts/add_address_service.rb', line 15

def call
  return if address_already_uploaded?

  add_address
end