Class: SDM::WorkflowRole

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

Overview

WorkflowRole links a role to a workflow. The linked roles indicate which roles a user must be a part of to request access to a resource via the workflow.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, role_id: nil, workflow_id: nil) ⇒ WorkflowRole

Returns a new instance of WorkflowRole.



12169
12170
12171
12172
12173
12174
12175
12176
12177
# File 'lib/models/porcelain.rb', line 12169

def initialize(
  id: nil,
  role_id: nil,
  workflow_id: nil
)
  @id = id == nil ? "" : id
  @role_id = role_id == nil ? "" : role_id
  @workflow_id = workflow_id == nil ? "" : workflow_id
end

Instance Attribute Details

#idObject

Unique identifier of the WorkflowRole.



12163
12164
12165
# File 'lib/models/porcelain.rb', line 12163

def id
  @id
end

#role_idObject

The role id.



12165
12166
12167
# File 'lib/models/porcelain.rb', line 12165

def role_id
  @role_id
end

#workflow_idObject

The workflow id.



12167
12168
12169
# File 'lib/models/porcelain.rb', line 12167

def workflow_id
  @workflow_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



12179
12180
12181
12182
12183
12184
12185
# File 'lib/models/porcelain.rb', line 12179

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