Class: FlowNodes::Flow

Inherits:
BaseNode show all
Defined in:
lib/flow_nodes/flow.rb

Overview

Orchestrates a sequence of connected nodes, managing state and transitions.

Direct Known Subclasses

AsyncFlow, BatchFlow

Instance Attribute Summary collapse

Attributes inherited from BaseNode

#params, #successors

Instance Method Summary collapse

Methods inherited from BaseNode

#-, #>>, #exec, #initialize_copy, #nxt, #run, #set_params

Constructor Details

#initialize(start: nil) ⇒ Flow

Returns a new instance of Flow.



8
9
10
11
# File 'lib/flow_nodes/flow.rb', line 8

def initialize(start: nil)
  super()
  @start_node = start
end

Instance Attribute Details

#start_nodeObject

Returns the value of attribute start_node.



6
7
8
# File 'lib/flow_nodes/flow.rb', line 6

def start_node
  @start_node
end

Instance Method Details

#start(node) ⇒ BaseNode

Sets the starting node of the flow.

Parameters:

  • The node to start the flow with.

Returns:

  • The starting node.



16
17
18
19
# File 'lib/flow_nodes/flow.rb', line 16

def start(node)
  @start_node = node
  node
end