Class: GraphBuilder::Node

Inherits:
Base
  • Object
show all
Defined in:
lib/graph_builder.rb

Direct Known Subclasses

Branch, Chain

Instance Attribute Summary

Attributes inherited from Base

#children, #opts, #parent

Instance Method Summary collapse

Methods inherited from Base

#ancestors, #debug, #depth, #dump, #empty?, #indent, #initialize, #process

Constructor Details

This class inherits a constructor from GraphBuilder::Base

Instance Method Details

#add_leaf(child) ⇒ Object



37
38
39
# File 'lib/graph_builder.rb', line 37

def add_leaf child
  add_node Leaf.new(self,child)
end

#add_node(node) ⇒ Object



41
42
43
44
# File 'lib/graph_builder.rb', line 41

def add_node node
  @children << node
  node
end

#to_sObject



46
47
48
# File 'lib/graph_builder.rb', line 46

def to_s
  "[#{self.class.name.split('::').last},empty?=#{empty?},f=#{first_things},l=#{last_things}]"
end