class ReVIEW::TOCParser::Node

Attributes

children[R]

Public Class Methods

new(children = []) click to toggle source
# File ../../../../../lib/review/tocparser.rb, line 123
def initialize(children = [])
  @children = children
end

Public Instance Methods

add_child(c) click to toggle source
# File ../../../../../lib/review/tocparser.rb, line 129
def add_child(c)
  @children.push c
end
chapter?() click to toggle source
# File ../../../../../lib/review/tocparser.rb, line 144
def chapter?
  false
end
each_child(&block) click to toggle source
# File ../../../../../lib/review/tocparser.rb, line 140
def each_child(&block)
  @children.each(&block)
end
each_node() { |c| ... } click to toggle source
# File ../../../../../lib/review/tocparser.rb, line 133
def each_node(&block)
  @children.each do |c|
    yield c
    c.each(&block)
  end
end
each_section(&block) click to toggle source
# File ../../../../../lib/review/tocparser.rb, line 148
def each_section(&block)
  @children.each do |n|
    n.yield_section(&block)
  end
end
each_section_with_index() { |n, i| ... } click to toggle source
# File ../../../../../lib/review/tocparser.rb, line 154
def each_section_with_index
  i = 0
  each_section do |n|
    yield n, i
    i += 1
  end
end
section_size() click to toggle source
# File ../../../../../lib/review/tocparser.rb, line 162
def section_size
  cnt = 0
  @children.each do |n|
    n.yield_section { cnt += 1 }
  end
  cnt
end