Class: ApiKeys::Services::Authenticator::Result
- Inherits:
-
Struct
- Object
- Struct
- ApiKeys::Services::Authenticator::Result
- Defined in:
- lib/api_keys/services/authenticator.rb
Overview
Result object for authentication attempts.
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#error_code ⇒ Object
Returns the value of attribute error_code.
-
#message ⇒ Object
Returns the value of attribute message.
-
#success? ⇒ Object
Returns the value of attribute success?.
Class Method Summary collapse
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key
17 18 19 |
# File 'lib/api_keys/services/authenticator.rb', line 17 def api_key @api_key end |
#error_code ⇒ Object
Returns the value of attribute error_code
17 18 19 |
# File 'lib/api_keys/services/authenticator.rb', line 17 def error_code @error_code end |
#message ⇒ Object
Returns the value of attribute message
17 18 19 |
# File 'lib/api_keys/services/authenticator.rb', line 17 def @message end |
#success? ⇒ Object
Returns the value of attribute success?
17 18 19 |
# File 'lib/api_keys/services/authenticator.rb', line 17
def success?
@success?
end
|
Class Method Details
.failure(error_code:, message:) ⇒ Object
22 23 24 |
# File 'lib/api_keys/services/authenticator.rb', line 22 def self.failure(error_code:, message:) new(success?: false, error_code: error_code, message: ) end |
.success(api_key) ⇒ Object
18 19 20 |
# File 'lib/api_keys/services/authenticator.rb', line 18 def self.success(api_key) new(success?: true, api_key: api_key) end |