Class: Propolize::LinesChunk

Inherits:
Object
  • Object
show all
Defined in:
lib/propolize.rb

Overview

A “chunk” of text from the source, corresponding to a group of lines, either delimited by a blank line, or, identifiable as a special one-line chunk from the contents of the line

Direct Known Subclasses

BlankTerminatedChunk, SpecialChunk

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line, options = {}) ⇒ LinesChunk

Returns a new instance of LinesChunk.



740
741
742
743
744
# File 'lib/propolize.rb', line 740

def initialize(line, options = {})
  @lines = [line]
  @isCritique = options[:isCritique] || false
  @tag = options[:tag]
end

Instance Attribute Details

#linesObject (readonly)

Returns the value of attribute lines.



738
739
740
# File 'lib/propolize.rb', line 738

def lines
  @lines
end

Instance Method Details

#addLine(line) ⇒ Object



746
747
748
# File 'lib/propolize.rb', line 746

def addLine(line)
  @lines.push(line)
end

#postProcessObject

a post-processing step in which a chunk might redefine itself as a different type of chunk based on information available only after all the lines have been added to it (in particular the case where a “heading” is defined by the occurrence of “——–” in the second and last line).



753
754
755
# File 'lib/propolize.rb', line 753

def postProcess
  return self
end