Class: FlowNodes::ConditionalTransition

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_nodes/conditional_transition.rb

Overview

Represents a pending conditional transition from one node to another.

Instance Method Summary collapse

Constructor Details

#initialize(source_node, action) ⇒ ConditionalTransition

Returns a new instance of ConditionalTransition.



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

def initialize(source_node, action)
  @source_node = source_node
  @action = action
end

Instance Method Details

#>>(other) ⇒ Object

Completes the transition by connecting the source node to the target.

Parameters:

  • target_node (BaseNode)

    The node to transition to.



13
14
15
# File 'lib/flow_nodes/conditional_transition.rb', line 13

def >>(other)
  @source_node.nxt(other, @action)
end