Class: Doodl::DirectedNode

Inherits:
Node
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/node.rb

Direct Known Subclasses

SimpleBidirectionalNode

Instance Method Summary collapse

Constructor Details

#initializeDirectedNode

Returns a new instance of DirectedNode.



30
31
32
# File 'lib/node.rb', line 30

def initialize
  @out_edges = []
end

Instance Method Details

#get_edge(target) ⇒ Object



40
41
42
# File 'lib/node.rb', line 40

def get_edge(target)
  @out_edges.select { |edge| edge.target == target}.first
end