Class: Protoboard::CircuitExecution
- Inherits:
-
Object
- Object
- Protoboard::CircuitExecution
- Defined in:
- lib/protoboard/circuit_execution.rb
Overview
This class represents a circuit execution.
Constant Summary collapse
- STATES =
%i[not_started success fail].freeze
Instance Attribute Summary collapse
-
#circuit ⇒ Object
readonly
Returns the value of attribute circuit.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #fail? ⇒ Boolean
-
#initialize(circuit, state: :pending, value: nil, error: nil) ⇒ CircuitExecution
constructor
A new instance of CircuitExecution.
Constructor Details
#initialize(circuit, state: :pending, value: nil, error: nil) ⇒ CircuitExecution
Returns a new instance of CircuitExecution.
11 12 13 14 15 16 |
# File 'lib/protoboard/circuit_execution.rb', line 11 def initialize(circuit, state: :pending, value: nil, error: nil) @circuit = circuit @state = state @value = value @error = error end |
Instance Attribute Details
#circuit ⇒ Object (readonly)
Returns the value of attribute circuit.
9 10 11 |
# File 'lib/protoboard/circuit_execution.rb', line 9 def circuit @circuit end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
9 10 11 |
# File 'lib/protoboard/circuit_execution.rb', line 9 def error @error end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
9 10 11 |
# File 'lib/protoboard/circuit_execution.rb', line 9 def state @state end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
9 10 11 |
# File 'lib/protoboard/circuit_execution.rb', line 9 def value @value end |
Instance Method Details
#fail? ⇒ Boolean
18 19 20 |
# File 'lib/protoboard/circuit_execution.rb', line 18 def fail? @state == :fail end |