Sha256: 8978f55890b7afc081669b91c463f94f5582eea9da87df5fe4df27c8308ebecf

Contents?: true

Size: 737 Bytes

Versions: 6

Compression:

Stored size: 737 Bytes

Contents

# frozen_string_literal: true

module Floe
  class Workflow
    module States
      class Succeed < Floe::Workflow::State
        attr_reader :input_path, :output_path

        def initialize(workflow, name, payload)
          super

          @input_path  = Path.new(payload.fetch("InputPath", "$"))
          @output_path = Path.new(payload.fetch("OutputPath", "$"))
        end

        def finish(context)
          input              = input_path.value(context, context.input)
          context.output     = output_path.value(context, input)
          context.next_state = nil

          super
        end

        def running?(_)
          false
        end

        def end?
          true
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
floe-0.15.1 lib/floe/workflow/states/succeed.rb
floe-0.15.0 lib/floe/workflow/states/succeed.rb
floe-0.14.0 lib/floe/workflow/states/succeed.rb
floe-0.13.1 lib/floe/workflow/states/succeed.rb
floe-0.13.0 lib/floe/workflow/states/succeed.rb
floe-0.12.0 lib/floe/workflow/states/succeed.rb