Sha256: 0d96034d3f5cbd342670672f95c25243596222d56e96a2bd2224d4f32c3348a6

Contents?: true

Size: 851 Bytes

Versions: 1

Compression:

Stored size: 851 Bytes

Contents

module Rung
  module Definition
    class Step
      include ValueObject
      # rubocop:disable Metrics/LineLength
      def initialize(action, from_block: false, run_on: :success, ignore_result: false, fail_fast: false)
        # rubocop:enable Metrics/LineLength
        @action = action
        @from_block = from_block
        @run_on = run_on
        @ignore_result = ignore_result
        @fail_fast = fail_fast
      end

      attr_reader :action, :from_block

      def run?(success)
        case @run_on
        when :success
          success
        when :failure
          !success
        when :any
          true
        else
          false
        end
      end

      def nested?
        false
      end

      def ignore_result?
        @ignore_result
      end

      def fail_fast?
        @fail_fast
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rung-0.1 lib/rung/definition/step.rb