Class: Treat::Workers::Formatters::Readers::ABW::ABWXmlHandler
- Inherits:
-
Object
- Object
- Treat::Workers::Formatters::Readers::ABW::ABWXmlHandler
- Includes:
- REXML::StreamListener
- Defined in:
- lib/treat/workers/formatters/readers/abw.rb
Overview
Helper class to parse the AbiWord file.
Instance Attribute Summary collapse
-
#plain_text ⇒ Object
readonly
Returns the value of attribute plain_text.
Instance Method Summary collapse
-
#initialize ⇒ ABWXmlHandler
constructor
A new instance of ABWXmlHandler.
- #text(s) ⇒ Object
Constructor Details
#initialize ⇒ ABWXmlHandler
Returns a new instance of ABWXmlHandler.
37 38 39 |
# File 'lib/treat/workers/formatters/readers/abw.rb', line 37 def initialize @plain_text = "" end |
Instance Attribute Details
#plain_text ⇒ Object (readonly)
Returns the value of attribute plain_text.
36 37 38 |
# File 'lib/treat/workers/formatters/readers/abw.rb', line 36 def plain_text @plain_text end |
Instance Method Details
#text(s) ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/treat/workers/formatters/readers/abw.rb', line 40 def text(s) if s != 'AbiWord' && s != 'application/x-abiword' s.strip! if s.length > 0 s += ' ' s += "\n\n" if s.length < 45 end @plain_text << s end end |