Class: ReVIEW::TOCParser::Paragraph
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
#initialize(page_metric) ⇒ Paragraph
Returns a new instance of Paragraph.
246
247
248
249
|
# File 'lib/review/tocparser.rb', line 246
def initialize(page_metric)
@bytes = 0
@page_metric = page_metric
end
|
Instance Method Details
#add(line) ⇒ Object
255
256
257
|
# File 'lib/review/tocparser.rb', line 255
def add(line)
@bytes += line.strip.bytesize
end
|
#estimated_lines ⇒ Object
259
260
261
|
# File 'lib/review/tocparser.rb', line 259
def estimated_lines
(@bytes + 2) / @page_metric.text.n_columns + 1
end
|
251
252
253
|
# File 'lib/review/tocparser.rb', line 251
def inspect
"\#<#{self.class}>"
end
|
#yield_section ⇒ Object
263
264
|
# File 'lib/review/tocparser.rb', line 263
def yield_section
end
|