Class: SDM::RoleAttachment

Inherits:
Object
  • Object
show all
Defined in:
lib/models/porcelain.rb

Overview

A RoleAttachment assigns a role to a composite role.

Deprecated: use multi-role via AccountAttachments instead.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attached_role_id: nil, composite_role_id: nil, id: nil) ⇒ RoleAttachment

Returns a new instance of RoleAttachment.



5367
5368
5369
5370
5371
5372
5373
5374
5375
# File 'lib/models/porcelain.rb', line 5367

def initialize(
  attached_role_id: nil,
  composite_role_id: nil,
  id: nil
)
  @attached_role_id = attached_role_id == nil ? "" : attached_role_id
  @composite_role_id = composite_role_id == nil ? "" : composite_role_id
  @id = id == nil ? "" : id
end

Instance Attribute Details

#attached_role_idObject

The id of the attached role of this RoleAttachment.



5361
5362
5363
# File 'lib/models/porcelain.rb', line 5361

def attached_role_id
  @attached_role_id
end

#composite_role_idObject

The id of the composite role of this RoleAttachment.



5363
5364
5365
# File 'lib/models/porcelain.rb', line 5363

def composite_role_id
  @composite_role_id
end

#idObject

Unique identifier of the RoleAttachment.



5365
5366
5367
# File 'lib/models/porcelain.rb', line 5365

def id
  @id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



5377
5378
5379
5380
5381
5382
5383
# File 'lib/models/porcelain.rb', line 5377

def to_json(options = {})
  hash = {}
  self.instance_variables.each do |var|
    hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var
  end
  hash.to_json
end