Class: Workarea::SetWishListDetails

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

Instance Method Summary collapse

Constructor Details

#initialize(wish_list) ⇒ SetWishListDetails

Returns a new instance of SetWishListDetails.



3
4
5
# File 'app/services/workarea/set_wish_list_details.rb', line 3

def initialize(wish_list)
  @wish_list = wish_list
end

Instance Method Details

#performObject



7
8
9
10
11
12
13
14
15
16
17
# File 'app/services/workarea/set_wish_list_details.rb', line 7

def perform
  return unless user.present?

  @wish_list.attributes = {
    email: user.email,
    first_name: user.first_name,
    last_name: user.last_name,
    name: user.name,
    location: location_for(user.default_billing_address)
  }
end

#perform!Object



19
20
21
# File 'app/services/workarea/set_wish_list_details.rb', line 19

def perform!
  perform && @wish_list.save!
end