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)


294
295
296
# File 'lib/review/tocparser.rb', line 294

def chapter?
  false
end

#each_section(&block) ⇒ Object



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

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

#each_section_with_indexObject



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

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

#estimated_linesObject



315
316
317
# File 'lib/review/tocparser.rb', line 315

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

#levelObject



290
291
292
# File 'lib/review/tocparser.rb', line 290

def level
  0
end

#n_sectionsObject



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

def n_sections
  chapters.size
end