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.



6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
# File 'lib/models/porcelain.rb', line 6406

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.



6404
6405
6406
# File 'lib/models/porcelain.rb', line 6404

def attached_role_id
  @attached_role_id
end

#composite_role_idObject

The id of the composite role of this RoleAttachment.



6402
6403
6404
# File 'lib/models/porcelain.rb', line 6402

def composite_role_id
  @composite_role_id
end

#idObject

Unique identifier of the RoleAttachment.



6400
6401
6402
# File 'lib/models/porcelain.rb', line 6400

def id
  @id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



6422
6423
6424
6425
6426
6427
6428
# File 'lib/models/porcelain.rb', line 6422

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