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.



4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
# File 'lib/models/porcelain.rb', line 4676

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.



4674
4675
4676
# File 'lib/models/porcelain.rb', line 4674

def attached_role_id
  @attached_role_id
end

#composite_role_idObject

The id of the composite role of this RoleAttachment.



4672
4673
4674
# File 'lib/models/porcelain.rb', line 4672

def composite_role_id
  @composite_role_id
end

#idObject

Unique identifier of the RoleAttachment.



4670
4671
4672
# File 'lib/models/porcelain.rb', line 4670

def id
  @id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



4692
4693
4694
4695
4696
4697
4698
# File 'lib/models/porcelain.rb', line 4692

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