Class: ULIParser

Inherits:
Parser show all
Defined in:
lib/Parsers/ULIParser.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.



5
6
7
# File 'lib/Parsers/ULIParser.rb', line 5

def nextParser
  @nextParser
end

Class Method Details

.isULI(paragraph) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/Parsers/ULIParser.rb', line 7

def self.isULI(paragraph)
    if paragraph.nil? 
        false
    else
        paragraph.type == "ULI"
    end
end

Instance Method Details

#parse(paragraph) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/Parsers/ULIParser.rb', line 15

def parse(paragraph)
    if ULIParser.isULI(paragraph)
        "- #{paragraph.text}"
    else
        if !nextParser.nil?
            nextParser.parse(paragraph)
        end
    end
end