Class: Legion::Identity::Grant
- Inherits:
-
Object
- Object
- Legion::Identity::Grant
- Defined in:
- lib/legion/identity/grant.rb
Instance Attribute Summary collapse
-
#expires_at ⇒ Object
readonly
Returns the value of attribute expires_at.
-
#grant_id ⇒ Object
readonly
Returns the value of attribute grant_id.
-
#provider ⇒ Object
readonly
Returns the value of attribute provider.
-
#purpose ⇒ Object
readonly
Returns the value of attribute purpose.
-
#qualifier ⇒ Object
readonly
Returns the value of attribute qualifier.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #denied? ⇒ Boolean
- #granted? ⇒ Boolean
-
#initialize(grant_id:, token:, provider:, result:, qualifier: :default, purpose: nil, reason: nil, expires_at: nil) ⇒ Grant
constructor
rubocop:disable Metrics/ParameterLists.
Constructor Details
#initialize(grant_id:, token:, provider:, result:, qualifier: :default, purpose: nil, reason: nil, expires_at: nil) ⇒ Grant
rubocop:disable Metrics/ParameterLists
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/legion/identity/grant.rb', line 8 def initialize(grant_id:, token:, provider:, result:, qualifier: :default, purpose: nil, reason: nil, expires_at: nil) # rubocop:disable Metrics/ParameterLists @grant_id = grant_id @token = token @provider = provider @qualifier = qualifier @purpose = purpose @result = result @reason = reason @expires_at = expires_at freeze end |
Instance Attribute Details
#expires_at ⇒ Object (readonly)
Returns the value of attribute expires_at.
6 7 8 |
# File 'lib/legion/identity/grant.rb', line 6 def expires_at @expires_at end |
#grant_id ⇒ Object (readonly)
Returns the value of attribute grant_id.
6 7 8 |
# File 'lib/legion/identity/grant.rb', line 6 def grant_id @grant_id end |
#provider ⇒ Object (readonly)
Returns the value of attribute provider.
6 7 8 |
# File 'lib/legion/identity/grant.rb', line 6 def provider @provider end |
#purpose ⇒ Object (readonly)
Returns the value of attribute purpose.
6 7 8 |
# File 'lib/legion/identity/grant.rb', line 6 def purpose @purpose end |
#qualifier ⇒ Object (readonly)
Returns the value of attribute qualifier.
6 7 8 |
# File 'lib/legion/identity/grant.rb', line 6 def qualifier @qualifier end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
6 7 8 |
# File 'lib/legion/identity/grant.rb', line 6 def reason @reason end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
6 7 8 |
# File 'lib/legion/identity/grant.rb', line 6 def result @result end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
6 7 8 |
# File 'lib/legion/identity/grant.rb', line 6 def token @token end |
Instance Method Details
#denied? ⇒ Boolean
21 |
# File 'lib/legion/identity/grant.rb', line 21 def denied? = result == :denied |
#granted? ⇒ Boolean
20 |
# File 'lib/legion/identity/grant.rb', line 20 def granted? = result == :granted |