Class: Propolize::LinesChunk
- Inherits:
-
Object
- Object
- Propolize::LinesChunk
- 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
Instance Attribute Summary collapse
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
Instance Method Summary collapse
- #addLine(line) ⇒ Object
-
#initialize(line, options = {}) ⇒ LinesChunk
constructor
A new instance of LinesChunk.
-
#postProcess ⇒ Object
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).
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, = {}) @lines = [line] @isCritique = [:isCritique] || false @tag = [:tag] end |
Instance Attribute Details
#lines ⇒ Object (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 |
#postProcess ⇒ Object
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 |