Sha256: afcf3f190e0c0f5d4dc1bb4fe878fc1b4c887cd5e47b14349392bc9925334992
Contents?: true
Size: 1.1 KB
Versions: 2
Compression:
Stored size: 1.1 KB
Contents
# frozen_string_literal: true module Floe class Workflow module States class Pass < Floe::Workflow::State attr_reader :end, :next, :result, :parameters, :input_path, :output_path, :result_path def initialize(workflow, name, payload) super @next = payload["Next"] @end = !!payload["End"] @result = payload["Result"] @parameters = PayloadTemplate.new(payload["Parameters"]) if payload["Parameters"] @input_path = Path.new(payload.fetch("InputPath", "$")) @output_path = Path.new(payload.fetch("OutputPath", "$")) @result_path = ReferencePath.new(payload.fetch("ResultPath", "$")) end def run!(input) output = input_path.value(context, input) output = result_path.set(output, result) if result && result_path output = output_path.value(context, output) [@end ? nil : @next, output] end def status @end ? "success" : "running" end def end? @end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
floe-0.3.1 | lib/floe/workflow/states/pass.rb |
floe-0.3.0 | lib/floe/workflow/states/pass.rb |