Method: Nanoc::Core::DirectedGraph#initialize
- Defined in:
- lib/nanoc/core/directed_graph.rb
#initialize(vertices) ⇒ DirectedGraph
Creates a new directed graph with the given vertices.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/nanoc/core/directed_graph.rb', line 41 def initialize(vertices) @vertices = {} @next_vertex_idx = 0 vertices.each do |v| @vertices[v] = @next_vertex_idx @next_vertex_idx += 1 end @to_graph = {} @edge_props = {} invalidate_caches end |