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.



4811
4812
4813
4814
4815
4816
4817
4818
4819
# File 'lib/models/porcelain.rb', line 4811

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.



4805
4806
4807
# File 'lib/models/porcelain.rb', line 4805

def attached_role_id
  @attached_role_id
end

#composite_role_idObject

The id of the composite role of this RoleAttachment.



4807
4808
4809
# File 'lib/models/porcelain.rb', line 4807

def composite_role_id
  @composite_role_id
end

#idObject

Unique identifier of the RoleAttachment.



4809
4810
4811
# File 'lib/models/porcelain.rb', line 4809

def id
  @id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



4821
4822
4823
4824
4825
4826
4827
# File 'lib/models/porcelain.rb', line 4821

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