Module: ReVIEW::TOCRoot

Included in:
Book::Base, Book::ChapterSet, Book::Part
Defined in:
lib/review/tocparser.rb

Instance Method Summary collapse

Instance Method Details

#chapter?Boolean

Returns:

  • (Boolean)


300
301
302
# File 'lib/review/tocparser.rb', line 300

def chapter?
  false
end

#each_section(&block) ⇒ Object



311
312
313
314
315
# File 'lib/review/tocparser.rb', line 311

def each_section(&block)
  each_chapter do |chap|
    yield chap.toc
  end
end

#each_section_with_indexObject



304
305
306
307
308
309
# File 'lib/review/tocparser.rb', line 304

def each_section_with_index
  idx = -1
  each_section do |node|
    yield node, (idx += 1)
  end
end

#estimated_linesObject



321
322
323
# File 'lib/review/tocparser.rb', line 321

def estimated_lines
  chapters.inject(0) {|sum, chap| sum + chap.toc.estimated_lines }
end

#levelObject



296
297
298
# File 'lib/review/tocparser.rb', line 296

def level
  0
end

#n_sectionsObject



317
318
319
# File 'lib/review/tocparser.rb', line 317

def n_sections
  chapters.size
end