Class: Workarea::GlobalE::Api::SendOrderToMerchant::SaveUser
- Inherits:
-
Object
- Object
- Workarea::GlobalE::Api::SendOrderToMerchant::SaveUser
- Defined in:
- app/services/workarea/global_e/api/send_order_to_merchant/save_user.rb
Instance Attribute Summary collapse
-
#billing_details ⇒ Object
readonly
Returns the value of attribute billing_details.
-
#culture_code ⇒ Object
readonly
Returns the value of attribute culture_code.
-
#shipping_details ⇒ Object
readonly
Returns the value of attribute shipping_details.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(user_id, shipping_details:, billing_details:, culture_code:) ⇒ SaveUser
constructor
A new instance of SaveUser.
- #perform! ⇒ Object
Constructor Details
#initialize(user_id, shipping_details:, billing_details:, culture_code:) ⇒ SaveUser
Returns a new instance of SaveUser.
21 22 23 24 25 26 |
# File 'app/services/workarea/global_e/api/send_order_to_merchant/save_user.rb', line 21 def initialize(user_id, shipping_details:, billing_details:, culture_code:) @user_id = user_id @shipping_details = shipping_details @billing_details = billing_details @culture_code = culture_code end |
Instance Attribute Details
#billing_details ⇒ Object (readonly)
Returns the value of attribute billing_details.
5 6 7 |
# File 'app/services/workarea/global_e/api/send_order_to_merchant/save_user.rb', line 5 def billing_details @billing_details end |
#culture_code ⇒ Object (readonly)
Returns the value of attribute culture_code.
5 6 7 |
# File 'app/services/workarea/global_e/api/send_order_to_merchant/save_user.rb', line 5 def culture_code @culture_code end |
#shipping_details ⇒ Object (readonly)
Returns the value of attribute shipping_details.
5 6 7 |
# File 'app/services/workarea/global_e/api/send_order_to_merchant/save_user.rb', line 5 def shipping_details @shipping_details end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
5 6 7 |
# File 'app/services/workarea/global_e/api/send_order_to_merchant/save_user.rb', line 5 def user_id @user_id end |
Class Method Details
.perform!(user_id, shipping_details:, billing_details:, culture_code:) ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'app/services/workarea/global_e/api/send_order_to_merchant/save_user.rb', line 7 def self.perform!(user_id, shipping_details:, billing_details:, culture_code:) new( user_id, shipping_details: shipping_details, billing_details: billing_details, culture_code: culture_code ).perform! end |
Instance Method Details
#perform! ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'app/services/workarea/global_e/api/send_order_to_merchant/save_user.rb', line 28 def perform! return if user.nil? upsert_address(shipping_details) upsert_address(billing_details) user.global_e_culture_code = culture_code user.save end |