Class: Otto::Security::AuthResult
- Inherits:
-
Object
- Object
- Otto::Security::AuthResult
- Defined in:
- lib/otto/security/authentication.rb
Overview
Result object for authentication attempts
Instance Attribute Summary collapse
-
#failure_reason ⇒ Object
readonly
Returns the value of attribute failure_reason.
-
#user_context ⇒ Object
readonly
Returns the value of attribute user_context.
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(success, user_context = {}, failure_reason = nil) ⇒ AuthResult
constructor
A new instance of AuthResult.
- #success? ⇒ Boolean
Constructor Details
#initialize(success, user_context = {}, failure_reason = nil) ⇒ AuthResult
Returns a new instance of AuthResult.
52 53 54 55 56 |
# File 'lib/otto/security/authentication.rb', line 52 def initialize(success, user_context = {}, failure_reason = nil) @success = success @user_context = user_context @failure_reason = failure_reason end |
Instance Attribute Details
#failure_reason ⇒ Object (readonly)
Returns the value of attribute failure_reason.
50 51 52 |
# File 'lib/otto/security/authentication.rb', line 50 def failure_reason @failure_reason end |
#user_context ⇒ Object (readonly)
Returns the value of attribute user_context.
50 51 52 |
# File 'lib/otto/security/authentication.rb', line 50 def user_context @user_context end |
Instance Method Details
#failure? ⇒ Boolean
62 63 64 |
# File 'lib/otto/security/authentication.rb', line 62 def failure? !@success end |
#success? ⇒ Boolean
58 59 60 |
# File 'lib/otto/security/authentication.rb', line 58 def success? @success end |