Method: Turbine::Node#initialize
- Defined in:
- lib/turbine/node.rb
#initialize(key, properties = nil) ⇒ Node
Creates a new Node.
key - A unique identifier for the node. The uniqueness of the key
is not checked upon initializing, but instead when the node
is added to the graph (Graph#add).
properties - Optional key/value properties to be associated with the
node.
Returns the node.
19 20 21 22 23 24 25 |
# File 'lib/turbine/node.rb', line 19 def initialize(key, properties = nil) @key = key @in_edges = Set.new @out_edges = Set.new self.properties = properties end |