Class: SDM::RoleAttachment

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

Overview

A RoleAttachment assigns a role to a composite role.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of RoleAttachment.



5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
# File 'lib/models/porcelain.rb', line 5069

def initialize(
  id: nil,
  composite_role_id: nil,
  attached_role_id: nil
)
  if id != nil
    @id = id
  end
  if composite_role_id != nil
    @composite_role_id = composite_role_id
  end
  if attached_role_id != nil
    @attached_role_id = attached_role_id
  end
end

Instance Attribute Details

#attached_role_idObject

The id of the attached role of this RoleAttachment.



5067
5068
5069
# File 'lib/models/porcelain.rb', line 5067

def attached_role_id
  @attached_role_id
end

#composite_role_idObject

The id of the composite role of this RoleAttachment.



5065
5066
5067
# File 'lib/models/porcelain.rb', line 5065

def composite_role_id
  @composite_role_id
end

#idObject

Unique identifier of the RoleAttachment.



5063
5064
5065
# File 'lib/models/porcelain.rb', line 5063

def id
  @id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



5085
5086
5087
5088
5089
5090
5091
# File 'lib/models/porcelain.rb', line 5085

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