Class: LangGraphRB::FanOutEdge
- Inherits:
-
Object
- Object
- LangGraphRB::FanOutEdge
- Defined in:
- lib/langgraph_rb/edge.rb
Overview
Fan-out edge that creates multiple parallel executions
Instance Attribute Summary collapse
-
#destinations ⇒ Object
readonly
Returns the value of attribute destinations.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
Instance Method Summary collapse
-
#initialize(from, destinations) ⇒ FanOutEdge
constructor
A new instance of FanOutEdge.
- #inspect ⇒ Object
- #route(state, context: nil) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(from, destinations) ⇒ FanOutEdge
Returns a new instance of FanOutEdge.
82 83 84 85 |
# File 'lib/langgraph_rb/edge.rb', line 82 def initialize(from, destinations) @from = from.to_sym @destinations = destinations.map(&:to_sym) end |
Instance Attribute Details
#destinations ⇒ Object (readonly)
Returns the value of attribute destinations.
80 81 82 |
# File 'lib/langgraph_rb/edge.rb', line 80 def destinations @destinations end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
80 81 82 |
# File 'lib/langgraph_rb/edge.rb', line 80 def from @from end |
Instance Method Details
#inspect ⇒ Object
95 96 97 |
# File 'lib/langgraph_rb/edge.rb', line 95 def inspect "#<FanOutEdge: #{to_s}>" end |
#route(state, context: nil) ⇒ Object
87 88 89 |
# File 'lib/langgraph_rb/edge.rb', line 87 def route(state, context: nil) @destinations end |
#to_s ⇒ Object
91 92 93 |
# File 'lib/langgraph_rb/edge.rb', line 91 def to_s "#{@from} -> #{@destinations.inspect}" end |