Class: Hydrangea::Graph

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/hydrangea/graph.rb

Instance Method Summary collapse

Constructor Details

#initialize(nodes) ⇒ Graph

Returns a new instance of Graph.



10
11
12
13
14
15
16
# File 'lib/hydrangea/graph.rb', line 10

def initialize(nodes)
  @nodes = case nodes
    when Set then nodes.to_a
    when Array then nodes.dup
    else nodes.each.to_a
  end
end