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.



5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
# File 'lib/models/porcelain.rb', line 5143

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.



5141
5142
5143
# File 'lib/models/porcelain.rb', line 5141

def attached_role_id
  @attached_role_id
end

#composite_role_idObject

The id of the composite role of this RoleAttachment.



5139
5140
5141
# File 'lib/models/porcelain.rb', line 5139

def composite_role_id
  @composite_role_id
end

#idObject

Unique identifier of the RoleAttachment.



5137
5138
5139
# File 'lib/models/porcelain.rb', line 5137

def id
  @id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



5159
5160
5161
5162
5163
5164
5165
# File 'lib/models/porcelain.rb', line 5159

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