Sha256: b2b80550e016ecd8859368fb5ad2d535f6aa7aed1c9f9461c65439ef8cabe60e

Contents?: true

Size: 784 Bytes

Versions: 1

Compression:

Stored size: 784 Bytes

Contents

module Rung
  module Runner
    class RunContext
      extend Forwardable

      def initialize(operation_instance, state)
        @operation_instance = operation_instance
        @state = state
        @failed = false
        @stopped = false
      end

      def_delegators :operation_class,
        :steps_definition, :around_callbacks,
        :around_each_callbacks
      attr_reader :operation_instance, :state

      def operation_class
        operation_instance.class
      end

      def fail!
        @failed = true
      end

      def stop!
        @stopped = true
      end

      def stopped?
        @stopped
      end

      def success?
        !@failed
      end

      def to_state
        State.new state, success?, operation_instance
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rung-0.1 lib/rung/runner/run_context.rb