module TreeStack::LeafType
Public Instance Methods
merge(leaf)
click to toggle source
# File lib/pseudohiki/treestack.rb, line 34 def merge(leaf) raise NotLeafError unless leaf.kind_of? Leaf return nil unless leaf.kind_of? Mergeable concat(leaf) end
push_self(stack)
click to toggle source
# File lib/pseudohiki/treestack.rb, line 28 def push_self(stack) @depth = stack.current_node.depth + 1 stack.push_as_leaf self self end