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)


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

def chapter?
  false
end

#each_section(&block) ⇒ Object



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

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

#each_section_with_indexObject



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

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

#estimated_linesObject



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

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

#levelObject



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

def level
  0
end

#n_sectionsObject



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

def n_sections
  chapters.size
end