Class: Rbgraph::DirectedGraph

Inherits:
Graph
  • Object
show all
Defined in:
lib/rbgraph/graphs/directed.rb

Instance Attribute Summary

Attributes inherited from Graph

#edges, #nodes

Instance Method Summary collapse

Methods inherited from Graph

#add_edge!, #add_node!, #as_json, #initialize, #inspect, #merge_nodes!, #remove_edge!, #remove_node!, #size, #to_json

Constructor Details

This class inherits a constructor from Rbgraph::Graph

Instance Method Details

#connect_nodes(node1, node2, edge) ⇒ Object



9
10
11
12
# File 'lib/rbgraph/graphs/directed.rb', line 9

def connect_nodes(node1, node2, edge)
  node1.connect_to(node2, edge)
  node2.edges[edge.id] ||= edge
end

#directed?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/rbgraph/graphs/directed.rb', line 5

def directed?
  true
end