Class: BQParser
Instance Attribute Summary collapse
-
#nextParser ⇒ Object
Returns the value of attribute nextParser.
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Parser
Constructor Details
This class inherits a constructor from Parser
Instance Attribute Details
#nextParser ⇒ Object
Returns the value of attribute nextParser.
7 8 9 |
# File 'lib/Parsers/BQParser.rb', line 7 def nextParser @nextParser end |
Class Method Details
.isBQ(paragraph) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/Parsers/BQParser.rb', line 9 def self.isBQ(paragraph) if paragraph.nil? false else paragraph.type == "BQ" end end |
Instance Method Details
#parse(paragraph) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/Parsers/BQParser.rb', line 17 def parse(paragraph) if BQParser.isBQ(paragraph) 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 |