Class: WorkOS::WidgetSessionToken

Inherits:
Types::BaseModel show all
Defined in:
lib/workos/widgets/widget_session_token.rb

Constant Summary collapse

HASH_ATTRS =
{
  organization_id: :organization_id,
  user_id: :user_id,
  scopes: :scopes
}.freeze

Instance Attribute Summary collapse

Attributes inherited from Types::BaseModel

#last_response

Instance Method Summary collapse

Methods inherited from Types::BaseModel

normalize

Methods included from HashProvider

#inspect, #to_h, #to_json

Constructor Details

#initialize(json) ⇒ WidgetSessionToken

Returns a new instance of WidgetSessionToken.



18
19
20
21
22
23
# File 'lib/workos/widgets/widget_session_token.rb', line 18

def initialize(json)
  hash = self.class.normalize(json)
  @organization_id = hash[:organization_id]
  @user_id = hash[:user_id]
  @scopes = hash[:scopes] || []
end

Instance Attribute Details

#organization_idObject

Returns the value of attribute organization_id.



13
14
15
# File 'lib/workos/widgets/widget_session_token.rb', line 13

def organization_id
  @organization_id
end

#scopesObject

Returns the value of attribute scopes.



13
14
15
# File 'lib/workos/widgets/widget_session_token.rb', line 13

def scopes
  @scopes
end

#user_idObject

Returns the value of attribute user_id.



13
14
15
# File 'lib/workos/widgets/widget_session_token.rb', line 13

def user_id
  @user_id
end