Class: Rafflesia::CliTokenData
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::CliTokenData
- Defined in:
- lib/rafflesia/auth/cli_token_data.rb
Constant Summary collapse
- HASH_ATTRS =
{ access_token: :access_token, entitlements: :entitlements, expires_at: :expires_at, organization_id: :organization_id, permissions: :permissions, refresh_token: :refresh_token, role: :role, session_id: :session_id, token_type: :token_type, user: :user }.freeze
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#entitlements ⇒ Object
Returns the value of attribute entitlements.
-
#expires_at ⇒ Object
Returns the value of attribute expires_at.
-
#organization_id ⇒ Object
Returns the value of attribute organization_id.
-
#permissions ⇒ Object
Returns the value of attribute permissions.
-
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
-
#role ⇒ Object
Returns the value of attribute role.
-
#session_id ⇒ Object
Returns the value of attribute session_id.
-
#token_type ⇒ Object
Returns the value of attribute token_type.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(json) ⇒ CliTokenData
constructor
A new instance of CliTokenData.
Constructor Details
#initialize(json) ⇒ CliTokenData
Returns a new instance of CliTokenData.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/rafflesia/auth/cli_token_data.rb', line 33 def initialize(json) super() hash = self.class.normalize(json) @access_token = hash[:access_token] @entitlements = (hash[:entitlements] || []) @expires_at = hash[:expires_at] @organization_id = hash[:organization_id] @permissions = (hash[:permissions] || []) @refresh_token = hash[:refresh_token] @role = hash[:role] @session_id = hash[:session_id] @token_type = hash[:token_type] @user = hash[:user] ? Rafflesia::AuthUser.new(hash[:user]) : nil end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
21 22 23 |
# File 'lib/rafflesia/auth/cli_token_data.rb', line 21 def access_token @access_token end |
#entitlements ⇒ Object
Returns the value of attribute entitlements.
21 22 23 |
# File 'lib/rafflesia/auth/cli_token_data.rb', line 21 def entitlements @entitlements end |
#expires_at ⇒ Object
Returns the value of attribute expires_at.
21 22 23 |
# File 'lib/rafflesia/auth/cli_token_data.rb', line 21 def expires_at @expires_at end |
#organization_id ⇒ Object
Returns the value of attribute organization_id.
21 22 23 |
# File 'lib/rafflesia/auth/cli_token_data.rb', line 21 def organization_id @organization_id end |
#permissions ⇒ Object
Returns the value of attribute permissions.
21 22 23 |
# File 'lib/rafflesia/auth/cli_token_data.rb', line 21 def @permissions end |
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
21 22 23 |
# File 'lib/rafflesia/auth/cli_token_data.rb', line 21 def refresh_token @refresh_token end |
#role ⇒ Object
Returns the value of attribute role.
21 22 23 |
# File 'lib/rafflesia/auth/cli_token_data.rb', line 21 def role @role end |
#session_id ⇒ Object
Returns the value of attribute session_id.
21 22 23 |
# File 'lib/rafflesia/auth/cli_token_data.rb', line 21 def session_id @session_id end |
#token_type ⇒ Object
Returns the value of attribute token_type.
21 22 23 |
# File 'lib/rafflesia/auth/cli_token_data.rb', line 21 def token_type @token_type end |
#user ⇒ Object
Returns the value of attribute user.
21 22 23 |
# File 'lib/rafflesia/auth/cli_token_data.rb', line 21 def user @user end |