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.



3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
# File 'lib/models/porcelain.rb', line 3041

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.



3032
3033
3034
# File 'lib/models/porcelain.rb', line 3032

def 
  @account_id
end

#group_idObject

The approver group id



3034
3035
3036
# File 'lib/models/porcelain.rb', line 3034

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.



3037
3038
3039
# File 'lib/models/porcelain.rb', line 3037

def reference
  @reference
end

#role_idObject

The approver role id



3039
3040
3041
# File 'lib/models/porcelain.rb', line 3039

def role_id
  @role_id
end

Instance Method Details

#to_json(options = {}) ⇒ Object



3053
3054
3055
3056
3057
3058
3059
# File 'lib/models/porcelain.rb', line 3053

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