Class: MPI::Responses::FindProfileResponse
- Inherits:
-
Object
- Object
- MPI::Responses::FindProfileResponse
- Defined in:
- lib/mpi/responses/find_profile_response.rb
Constant Summary collapse
- STATUS =
[OK = :ok, NOT_FOUND = :not_found, SERVER_ERROR = :server_error].freeze
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#profile ⇒ Object
readonly
Returns the value of attribute profile.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #cache? ⇒ Boolean
-
#initialize(status:, profile: nil, error: nil) ⇒ FindProfileResponse
constructor
A new instance of FindProfileResponse.
- #not_found? ⇒ Boolean
- #ok? ⇒ Boolean
- #server_error? ⇒ Boolean
Constructor Details
#initialize(status:, profile: nil, error: nil) ⇒ FindProfileResponse
Returns a new instance of FindProfileResponse.
10 11 12 13 14 |
# File 'lib/mpi/responses/find_profile_response.rb', line 10 def initialize(status:, profile: nil, error: nil) @status = status @profile = profile @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
6 7 8 |
# File 'lib/mpi/responses/find_profile_response.rb', line 6 def error @error end |
#profile ⇒ Object (readonly)
Returns the value of attribute profile.
6 7 8 |
# File 'lib/mpi/responses/find_profile_response.rb', line 6 def profile @profile end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
6 7 8 |
# File 'lib/mpi/responses/find_profile_response.rb', line 6 def status @status end |
Instance Method Details
#cache? ⇒ Boolean
16 17 18 |
# File 'lib/mpi/responses/find_profile_response.rb', line 16 def cache? ok? || not_found? end |
#not_found? ⇒ Boolean
24 25 26 |
# File 'lib/mpi/responses/find_profile_response.rb', line 24 def not_found? @status == NOT_FOUND end |
#ok? ⇒ Boolean
20 21 22 |
# File 'lib/mpi/responses/find_profile_response.rb', line 20 def ok? @status == OK end |
#server_error? ⇒ Boolean
28 29 30 |
# File 'lib/mpi/responses/find_profile_response.rb', line 28 def server_error? @status == SERVER_ERROR end |