Sha256: 312864aa2aafeb5f80f35017e6409cb9a7f45b074e09d819f072b31dc562ff7a

Contents?: true

Size: 446 Bytes

Versions: 9

Compression:

Stored size: 446 Bytes

Contents

# frozen_string_literal: true

module Protoboard
  ##
  # This class represents a circuit execution.
  class CircuitExecution
    STATES = %i[not_started success fail].freeze

    attr_reader :circuit, :state, :value, :error

    def initialize(circuit, state: :pending, value: nil, error: nil)
      @circuit = circuit
      @state = state
      @value = value
      @error = error
    end

    def fail?
      @state == :fail
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
protoboard-0.2.3 lib/protoboard/circuit_execution.rb
protoboard-0.2.2 lib/protoboard/circuit_execution.rb
protoboard-0.2.1 lib/protoboard/circuit_execution.rb
protoboard-0.2.0 lib/protoboard/circuit_execution.rb
protoboard-0.1.5 lib/protoboard/circuit_execution.rb
protoboard-0.1.4 lib/protoboard/circuit_execution.rb
protoboard-0.1.3 lib/protoboard/circuit_execution.rb
protoboard-0.1.2 lib/protoboard/circuit_execution.rb
protoboard-0.1.1 lib/protoboard/circuit_execution.rb