Class: WorkOS::UserRoleAssignmentSource

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/workos/authorization/user_role_assignment_source.rb

Constant Summary collapse

HASH_ATTRS =
{
  type: :type,
  group_role_assignment_id: :group_role_assignment_id,
  group: :group
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ UserRoleAssignmentSource

Returns a new instance of UserRoleAssignmentSource.



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

def initialize(json)
  hash = self.class.normalize(json)
  @type = hash[:type]
  @group_role_assignment_id = hash[:group_role_assignment_id]
  @group = hash[:group] ? WorkOS::UserRoleAssignmentSourceGroup.new(hash[:group]) : nil
end

Instance Attribute Details

#group ⇒ Object

Returns the value of attribute group.



13
14
15
# File 'lib/workos/authorization/user_role_assignment_source.rb', line 13

def group
  @group
end

#group_role_assignment_id ⇒ Object

Returns the value of attribute group_role_assignment_id.



13
14
15
# File 'lib/workos/authorization/user_role_assignment_source.rb', line 13

def group_role_assignment_id
  @group_role_assignment_id
end

#type ⇒ Object

Returns the value of attribute type.



13
14
15
# File 'lib/workos/authorization/user_role_assignment_source.rb', line 13

def type
  @type
end