Class: SDM::ApprovalFlowApprover
- Inherits:
-
Object
- Object
- SDM::ApprovalFlowApprover
- 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
-
#account_id ⇒ Object
The approver account id.
-
#reference ⇒ Object
A reference to an approver.
-
#role_id ⇒ Object
The approver role id.
Instance Method Summary collapse
-
#initialize(account_id: nil, reference: nil, role_id: nil) ⇒ ApprovalFlowApprover
constructor
A new instance of ApprovalFlowApprover.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(account_id: nil, reference: nil, role_id: nil) ⇒ ApprovalFlowApprover
2656 2657 2658 2659 2660 2661 2662 2663 2664 |
# File 'lib/models/porcelain.rb', line 2656 def initialize( account_id: nil, reference: nil, role_id: nil ) @account_id = account_id == nil ? "" : account_id @reference = reference == nil ? "" : reference @role_id = role_id == nil ? "" : role_id end |
Instance Attribute Details
#account_id ⇒ Object
The approver account id.
2649 2650 2651 |
# File 'lib/models/porcelain.rb', line 2649 def account_id @account_id end |
#reference ⇒ Object
A reference to an approver. Must be one of ApproverReference constants. If set, the account_id and role_id must be empty.
2652 2653 2654 |
# File 'lib/models/porcelain.rb', line 2652 def reference @reference end |
#role_id ⇒ Object
The approver role id
2654 2655 2656 |
# File 'lib/models/porcelain.rb', line 2654 def role_id @role_id end |
Instance Method Details
#to_json(options = {}) ⇒ Object
2666 2667 2668 2669 2670 2671 2672 |
# File 'lib/models/porcelain.rb', line 2666 def to_json( = {}) hash = {} self.instance_variables.each do |var| hash[var.id2name.delete_prefix("@")] = self.instance_variable_get var end hash.to_json end |