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.



4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
# File 'lib/models/porcelain.rb', line 4104

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.



4102
4103
4104
# File 'lib/models/porcelain.rb', line 4102

def attached_role_id
  @attached_role_id
end

#composite_role_idObject

The id of the composite role of this RoleAttachment.



4100
4101
4102
# File 'lib/models/porcelain.rb', line 4100

def composite_role_id
  @composite_role_id
end

#idObject

Unique identifier of the RoleAttachment.



4098
4099
4100
# File 'lib/models/porcelain.rb', line 4098

def id
  @id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



4120
4121
4122
4123
4124
4125
4126
# File 'lib/models/porcelain.rb', line 4120

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