Class: PParser

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

Instance Attribute Summary collapse

Class Method 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/PParser.rb', line 7

def nextParser
  @nextParser
end

Class Method Details

.getTypeStringObject



9
10
11
# File 'lib/Parsers/PParser.rb', line 9

def self.getTypeString()
    'P'
end

Instance Method Details

#parse(paragraph) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/Parsers/PParser.rb', line 13

def parse(paragraph)
    if paragraph.type == PParser.getTypeString()
        "\n#{paragraph.text}"
    else
        if !nextParser.nil?
            nextParser.parse(paragraph)
        end
    end
end