Class: PQParser

Inherits:
Parser show all
Defined in:
lib/Parsers/PQParser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Parser

#initialize, #setNext

Constructor Details

This class inherits a constructor from Parser

Instance Attribute Details

#nextParserObject

Returns the value of attribute nextParser.



7
8
9
# File 'lib/Parsers/PQParser.rb', line 7

def nextParser
  @nextParser
end

Instance Method Details

#parse(paragraph) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/Parsers/PQParser.rb', line 8

def parse(paragraph)
    if paragraph.type == 'PQ'
        result = "\r\n\r\n"
        paragraph.text.each_line do |p|
            result += "> #{p} \n\n"
        end
        result += "\r\n\r\n"

        result
    else
        if !nextParser.nil?
            nextParser.parse(paragraph)
        end
    end
end