Class: SDM::ApprovalFlowStep
- Inherits:
-
Object
- Object
- SDM::ApprovalFlowStep
- Defined in:
- lib/models/porcelain.rb
Overview
An approval step for an approval workflow. Specifies approvers and conditions for approval to be granted.
Instance Attribute Summary collapse
-
#approvers ⇒ Object
The approvers for this approval step.
-
#quantifier ⇒ Object
Whether "any" or "all" approvers must approve for this approval step to pass.
-
#skip_after ⇒ Object
Duration after which this approval step will be skipped if no approval is given.
Instance Method Summary collapse
-
#initialize(approvers: nil, quantifier: nil, skip_after: nil) ⇒ ApprovalFlowStep
constructor
A new instance of ApprovalFlowStep.
- #to_json(options = {}) ⇒ Object
Constructor Details
#initialize(approvers: nil, quantifier: nil, skip_after: nil) ⇒ ApprovalFlowStep
Returns a new instance of ApprovalFlowStep.
2607 2608 2609 2610 2611 2612 2613 2614 2615 |
# File 'lib/models/porcelain.rb', line 2607 def initialize( approvers: nil, quantifier: nil, skip_after: nil ) @approvers = approvers == nil ? [] : approvers @quantifier = quantifier == nil ? "" : quantifier @skip_after = skip_after == nil ? nil : skip_after end |
Instance Attribute Details
#approvers ⇒ Object
The approvers for this approval step
2601 2602 2603 |
# File 'lib/models/porcelain.rb', line 2601 def approvers @approvers end |
#quantifier ⇒ Object
Whether "any" or "all" approvers must approve for this approval step to pass. Optional, defaults to "any".
2603 2604 2605 |
# File 'lib/models/porcelain.rb', line 2603 def quantifier @quantifier end |
#skip_after ⇒ Object
Duration after which this approval step will be skipped if no approval is given. Optional, if not provided an approver must approve before the step passes.
2605 2606 2607 |
# File 'lib/models/porcelain.rb', line 2605 def skip_after @skip_after end |
Instance Method Details
#to_json(options = {}) ⇒ Object
2617 2618 2619 2620 2621 2622 2623 |
# File 'lib/models/porcelain.rb', line 2617 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 |