Class: Rbgraph::DirectedGraph
- Defined in:
- lib/rbgraph/graphs/directed.rb
Instance Attribute Summary
Attributes inherited from Graph
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
5 6 7 |
# File 'lib/rbgraph/graphs/directed.rb', line 5 def directed? true end |