class GraphNode

Attributes

connections[R]
content[RW]
marked[RW]
name[RW]

Public Class Methods

new(name, content) click to toggle source
# File lib/node/graph_node.rb, line 9
def initialize name, content
        @name = name
        @content = content
        @connections = {}
        @marked = false
end

Public Instance Methods

addConnection(to, weight) click to toggle source
# File lib/node/graph_node.rb, line 16
def addConnection to, weight
        @connections[to] = Connection.new(to,weight)
end
connectedTo?(name) click to toggle source
# File lib/node/graph_node.rb, line 24
def connectedTo? name
        return getConnection(name) != nil
end
getConnection(name) click to toggle source
# File lib/node/graph_node.rb, line 20
def getConnection name
        return @connections[name]
end