Class: Propolize::ParagraphChunk

Inherits:
BlankTerminatedChunk show all
Defined in:
lib/propolize.rb

Overview

A paragraph chunk is a group of lines representing a paragraph (because it is not recognisable as anything else)

Instance Attribute Summary

Attributes inherited from LinesChunk

#lines

Instance Method Summary collapse

Methods inherited from BlankTerminatedChunk

#critiqueValue, #isTerminatedBy?

Methods inherited from LinesChunk

#addLine, #initialize

Constructor Details

This class inherits a constructor from Propolize::LinesChunk

Instance Method Details

#getDocumentComponentObject



834
835
836
# File 'lib/propolize.rb', line 834

def getDocumentComponent
  return Paragraph.new(lines.join("\n"), :isCritique => @isCritique, :tag => @tag)
end

#postProcessObject

Check if this paragraph is actually a heading, as determined by the 2nd line being an underline sequence



826
827
828
829
830
831
832
# File 'lib/propolize.rb', line 826

def postProcess
  if lines.length == 2 and lines[1].match(/^[-]+$/) then
    return HeadingChunk.new(lines[0])
  else
    return self
  end
end

#to_sObject



821
822
823
# File 'lib/propolize.rb', line 821

def to_s
  return "ParagraphChunk: #{critiqueValue}#{lines.inspect}"
end