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)


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

def chapter?
  false
end

#each_section(&block) ⇒ Object



307
308
309
310
311
# File 'lib/review/tocparser.rb', line 307

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

#each_section_with_indexObject



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

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

#estimated_linesObject



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

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

#levelObject



292
293
294
# File 'lib/review/tocparser.rb', line 292

def level
  0
end

#n_sectionsObject



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

def n_sections
  chapters.size
end