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.



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

def initialize
  @bytes = 0
end

Instance Method Details

#add(line) ⇒ Object



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

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

#estimated_linesObject



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

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

#inspectObject



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

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

#yield_sectionObject



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

def yield_section
end