Class: Rafflesia::SessionPayload
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Rafflesia::SessionPayload
- Defined in:
- lib/rafflesia/auth/session_payload.rb
Constant Summary collapse
- HASH_ATTRS =
{ entitlements: :entitlements, organization_id: :organization_id, permissions: :permissions, role: :role, session_id: :session_id, user: :user }.freeze
Instance Attribute Summary collapse
-
#entitlements ⇒ Object
Returns the value of attribute entitlements.
-
#organization_id ⇒ Object
Returns the value of attribute organization_id.
-
#permissions ⇒ Object
Returns the value of attribute permissions.
-
#role ⇒ Object
Returns the value of attribute role.
-
#session_id ⇒ Object
Returns the value of attribute session_id.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(json) ⇒ SessionPayload
constructor
A new instance of SessionPayload.
Constructor Details
#initialize(json) ⇒ SessionPayload
Returns a new instance of SessionPayload.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/rafflesia/auth/session_payload.rb', line 25 def initialize(json) super() hash = self.class.normalize(json) @entitlements = (hash[:entitlements] || []) @organization_id = hash[:organization_id] @permissions = (hash[:permissions] || []) @role = hash[:role] @session_id = hash[:session_id] @user = hash[:user] ? Rafflesia::AuthUser.new(hash[:user]) : nil end |
Instance Attribute Details
#entitlements ⇒ Object
Returns the value of attribute entitlements.
17 18 19 |
# File 'lib/rafflesia/auth/session_payload.rb', line 17 def entitlements @entitlements end |
#organization_id ⇒ Object
Returns the value of attribute organization_id.
17 18 19 |
# File 'lib/rafflesia/auth/session_payload.rb', line 17 def organization_id @organization_id end |
#permissions ⇒ Object
Returns the value of attribute permissions.
17 18 19 |
# File 'lib/rafflesia/auth/session_payload.rb', line 17 def @permissions end |
#role ⇒ Object
Returns the value of attribute role.
17 18 19 |
# File 'lib/rafflesia/auth/session_payload.rb', line 17 def role @role end |
#session_id ⇒ Object
Returns the value of attribute session_id.
17 18 19 |
# File 'lib/rafflesia/auth/session_payload.rb', line 17 def session_id @session_id end |
#user ⇒ Object
Returns the value of attribute user.
17 18 19 |
# File 'lib/rafflesia/auth/session_payload.rb', line 17 def user @user end |