Class: UserService::Update
- Inherits:
-
Object
- Object
- UserService::Update
- Includes:
- DefaultErrorContainer
- Defined in:
- app/services/user_service/update.rb
Instance Attribute Summary collapse
-
#user ⇒ Object
Returns the value of attribute user.
-
#valid_params ⇒ Object
Returns the value of attribute valid_params.
Instance Method Summary collapse
-
#initialize(user, valid_params) ⇒ Update
constructor
A new instance of Update.
- #update_account ⇒ Object
- #update_account! ⇒ Object
- #valid? ⇒ Boolean
Methods included from DefaultErrorContainer
#error, #error_message_simple, #merge_errors
Constructor Details
#initialize(user, valid_params) ⇒ Update
Returns a new instance of Update.
5 6 7 8 |
# File 'app/services/user_service/update.rb', line 5 def initialize(user, valid_params) @user = user @valid_params = valid_params end |
Instance Attribute Details
#user ⇒ Object
Returns the value of attribute user.
3 4 5 |
# File 'app/services/user_service/update.rb', line 3 def user @user end |
#valid_params ⇒ Object
Returns the value of attribute valid_params.
3 4 5 |
# File 'app/services/user_service/update.rb', line 3 def valid_params @valid_params end |
Instance Method Details
#update_account ⇒ Object
17 18 19 20 21 22 |
# File 'app/services/user_service/update.rb', line 17 def update_account update_account! rescue StandardError => e APMErrorHandler.report(e) false end |
#update_account! ⇒ Object
24 25 26 27 28 |
# File 'app/services/user_service/update.rb', line 24 def update_account! update_data true end |
#valid? ⇒ Boolean
10 11 12 13 14 15 |
# File 'app/services/user_service/update.rb', line 10 def valid? return false if user.blank? return false if errors.present? true end |