Class: Workarea::SetWishListDetails
- Inherits:
-
Object
- Object
- Workarea::SetWishListDetails
- Defined in:
- app/services/workarea/set_wish_list_details.rb
Instance Method Summary collapse
-
#initialize(wish_list) ⇒ SetWishListDetails
constructor
A new instance of SetWishListDetails.
- #perform ⇒ Object
- #perform! ⇒ Object
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
#perform ⇒ Object
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 |