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 167 def initialize(level, label, path = nil) super() @level = level @label = label @filename = (path ? real_filename(path) : nil) end
Public Instance Methods
display_label()
click to toggle source
# File lib/review/tocparser.rb, line 186 def display_label if @filename @label + ' ' + @filename else @label end end
estimated_lines()
click to toggle source
# File lib/review/tocparser.rb, line 194 def estimated_lines @children.inject(0) {|sum, n| sum + n.estimated_lines } end
inspect()
click to toggle source
# File lib/review/tocparser.rb, line 202 def inspect "\#<#{self.class} level=#{@level} #{@label}>" end
yield_section() { |self| ... }
click to toggle source
# File lib/review/tocparser.rb, line 198 def yield_section yield self end
Private Instance Methods
real_filename(path)
click to toggle source
# File lib/review/tocparser.rb, line 174 def real_filename(path) if FileTest.symlink?(path) File.basename(File.readlink(path)) else File.basename(path) end end