class PatchworkInternal::Node

Attributes

data[R]
id[R]

Public Class Methods

new(data) click to toggle source
# File lib/patchwork/node.rb, line 11
def initialize(data)
  @data = data
  @links = []
  @id = SecureRandom.uuid
end

Public Instance Methods

depth_first(&block) click to toggle source
# File lib/patchwork/node.rb, line 36
def depth_first(&block)
  Traversals.depth_first(self, &block)
end
linked_nodes() click to toggle source
# File lib/patchwork/node.rb, line 24
def linked_nodes
  @links.map(&:node_end)
end
neighbor?(node) click to toggle source
# File lib/patchwork/node.rb, line 28
def neighbor?(node)
  @links.any? { |link| link.links_to(node) }
end
visit() { |self| ... } click to toggle source
# File lib/patchwork/node.rb, line 32
def visit
  yield self
end