Sha256: 36e40806b594d167a6b19a4842dd70011fb241a1d252a5ae741ba094539e4021

Contents?: true

Size: 930 Bytes

Versions: 7

Compression:

Stored size: 930 Bytes

Contents

# frozen_string_literal: true

module Floe
  class Workflow
    module States
      module InputOutputMixin
        def process_input(context)
          input = input_path.value(context, context.input)
          input = parameters.value(context, input) if parameters
          input
        end

        def process_output(context, results)
          return context.input.dup if results.nil?
          return if output_path.nil?

          results = result_selector.value(context, results) if @result_selector
          if result_path.payload.start_with?("$.Credentials")
            credentials = result_path.set(context.credentials, results)["Credentials"]
            context.credentials.merge!(credentials)
            output = context.input.dup
          else
            output = result_path.set(context.input.dup, results)
          end

          output_path.value(context, output)
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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