Class: Users::Profile
- Inherits:
-
Object
- Object
- Users::Profile
- Includes:
- Common::Client::Concerns::ServiceStatus
- Defined in:
- app/services/users/profile.rb
Constant Summary collapse
- HTTP_OK =
200
- HTTP_SOME_ERRORS =
296
Constants included from Common::Client::Concerns::ServiceStatus
Common::Client::Concerns::ServiceStatus::RESPONSE_STATUS
Instance Attribute Summary collapse
-
#scaffold ⇒ Object
readonly
Returns the value of attribute scaffold.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(user, session = nil) ⇒ Profile
constructor
A new instance of Profile.
-
#pre_serialize ⇒ Struct
Fetches and serializes all of the initialized user’s profile data that is returned in the ‘/v0/user’ endpoint.
Constructor Details
Instance Attribute Details
#scaffold ⇒ Object (readonly)
Returns the value of attribute scaffold.
13 14 15 |
# File 'app/services/users/profile.rb', line 13 def scaffold @scaffold end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
13 14 15 |
# File 'app/services/users/profile.rb', line 13 def user @user end |
Instance Method Details
#pre_serialize ⇒ Struct
Fetches and serializes all of the initialized user’s profile data that is returned in the ‘/v0/user’ endpoint.
If there are no external service errors, the status property is set to 200, and the ‘errors` property is set to nil.
If there are errors from any associated external services, the status property is set to 296, and serialized versions of the errors are added to the ‘errors` array.
33 34 35 36 37 |
# File 'app/services/users/profile.rb', line 33 def pre_serialize fetch_and_serialize_profile update_status_and_errors scaffold end |