Class: ReVIEW::TOCParser::Paragraph

Inherits:
Node show all
Defined in:
lib/review/tocparser.rb

Instance Attribute Summary

Attributes inherited from Node

#children

Instance Method Summary collapse

Methods inherited from Node

#add_child, #chapter?, #each_child, #each_node, #each_section, #each_section_with_index, #n_sections

Constructor Details

#initializeParagraph

Returns a new instance of Paragraph.



242
243
244
# File 'lib/review/tocparser.rb', line 242

def initialize
  @bytes = 0
end

Instance Method Details

#add(line) ⇒ Object



250
251
252
# File 'lib/review/tocparser.rb', line 250

def add(line)
  @bytes += line.strip.bytesize
end

#estimated_linesObject



254
255
256
# File 'lib/review/tocparser.rb', line 254

def estimated_lines
  (@bytes + 2) / ReVIEW.book.page_metric.text.n_columns + 1
end

#inspectObject



246
247
248
# File 'lib/review/tocparser.rb', line 246

def inspect
  "\#<#{self.class}>"
end

#yield_sectionObject



258
259
# File 'lib/review/tocparser.rb', line 258

def yield_section
end