class ReVIEW::TOCParser::Section

Attributes

label[R]
level[R]

Public Class Methods

new(level, label, path = nil) click to toggle source
Calls superclass method ReVIEW::TOCParser::Node::new
# File lib/review/tocparser.rb, line 165
def initialize(level, label, path = nil)
  super()
  @level = level
  @label = label
  @filename = path ? real_filename(path) : nil
end

Public Instance Methods

estimated_lines() click to toggle source
# File lib/review/tocparser.rb, line 184
def estimated_lines
  @children.inject(0) { |sum, n| sum + n.estimated_lines }
end
inspect() click to toggle source
# File lib/review/tocparser.rb, line 192
def inspect
  "#<#{self.class} level=#{@level} #{@label}>"
end
yield_section() { |self| ... } click to toggle source
# File lib/review/tocparser.rb, line 188
def yield_section
  yield self
end

Private Instance Methods

real_filename(path) click to toggle source
# File lib/review/tocparser.rb, line 172
def real_filename(path)
  if FileTest.symlink?(path)
    File.basename(File.readlink(path))
  else
    File.basename(path)
  end
end