Sha256: 3dd41ebd3a1fe2fd68211b89e63e3e9d351ff55c6154dc6440ae9da0c66b38b6

Contents?: true

Size: 785 Bytes

Versions: 2

Compression:

Stored size: 785 Bytes

Contents

# frozen_string_literal: true

module Floe
  class Workflow
    module States
      class Fail < Floe::Workflow::State
        attr_reader :cause, :error

        def initialize(workflow, name, payload)
          super

          @cause = payload["Cause"]
          @error = payload["Error"]
        end

        def run!(input)
          logger.info("Running state: [#{name}] with input [#{input}]")

          next_state = nil
          output     = input

          logger.info("Running state: [#{name}] with input [#{input}]...Complete - next state: [#{next_state&.name}]")

          [next_state, output]
        end

        def end?
          true
        end

        private def to_dot_attributes
          super.merge(:color => "red")
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
floe-0.1.1 lib/floe/workflow/states/fail.rb
floe-0.1.0 lib/floe/workflow/states/fail.rb