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.



5327
5328
5329
5330
5331
5332
5333
5334
5335
# File 'lib/models/porcelain.rb', line 5327

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.



5321
5322
5323
# File 'lib/models/porcelain.rb', line 5321

def attached_role_id
  @attached_role_id
end

#composite_role_idObject

The id of the composite role of this RoleAttachment.



5323
5324
5325
# File 'lib/models/porcelain.rb', line 5323

def composite_role_id
  @composite_role_id
end

#idObject

Unique identifier of the RoleAttachment.



5325
5326
5327
# File 'lib/models/porcelain.rb', line 5325

def id
  @id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



5337
5338
5339
5340
5341
5342
5343
# File 'lib/models/porcelain.rb', line 5337

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