Class: SDM::ApprovalFlowApprover

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

Overview

An approver for an approval workflow step. Each approver can specify exactly one of: account_id, role_id, or reference

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account_id: nil, group_id: nil, reference: nil, role_id: nil) ⇒ ApprovalFlowApprover

Returns a new instance of ApprovalFlowApprover.



3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
# File 'lib/models/porcelain.rb', line 3290

def initialize(
  account_id: nil,
  group_id: nil,
  reference: nil,
  role_id: nil
)
  @account_id =  == nil ? "" : 
  @group_id = group_id == nil ? "" : group_id
  @reference = reference == nil ? "" : reference
  @role_id = role_id == nil ? "" : role_id
end

Instance Attribute Details

#account_idObject

The approver account id.



3281
3282
3283
# File 'lib/models/porcelain.rb', line 3281

def 
  @account_id
end

#group_idObject

The approver group id



3283
3284
3285
# File 'lib/models/porcelain.rb', line 3283

def group_id
  @group_id
end

#referenceObject

A reference to an approver. Must be one of ApproverReference constants. If set, the account_id and role_id must be empty.



3286
3287
3288
# File 'lib/models/porcelain.rb', line 3286

def reference
  @reference
end

#role_idObject

The approver role id



3288
3289
3290
# File 'lib/models/porcelain.rb', line 3288

def role_id
  @role_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



3302
3303
3304
3305
3306
3307
3308
# File 'lib/models/porcelain.rb', line 3302

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