Class: GraphAgent::Graph::ConditionalEdge

Inherits:
Object
  • Object
show all
Defined in:
lib/graph_agent/graph/conditional_edge.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, path, path_map: nil) ⇒ ConditionalEdge

Returns a new instance of ConditionalEdge.



8
9
10
11
12
# File 'lib/graph_agent/graph/conditional_edge.rb', line 8

def initialize(source, path, path_map: nil)
  @source = source.to_s
  @path = path
  @path_map = path_map
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



6
7
8
# File 'lib/graph_agent/graph/conditional_edge.rb', line 6

def path
  @path
end

#path_mapObject (readonly)

Returns the value of attribute path_map.



6
7
8
# File 'lib/graph_agent/graph/conditional_edge.rb', line 6

def path_map
  @path_map
end

#sourceObject (readonly)

Returns the value of attribute source.



6
7
8
# File 'lib/graph_agent/graph/conditional_edge.rb', line 6

def source
  @source
end

Instance Method Details

#resolve(state, config = {}) ⇒ Object



14
15
16
17
# File 'lib/graph_agent/graph/conditional_edge.rb', line 14

def resolve(state, config = {})
  result = invoke_path(state, config)
  _resolve_result(result)
end