Class: TextExtractor::PlaintextHandler
- Inherits:
-
FileHandler
- Object
- FileHandler
- TextExtractor::PlaintextHandler
- Defined in:
- lib/text_extractor/file_handler/plaintext_handler.rb
Constant Summary collapse
- CONTENT_TYPES =
%w(text/csv text/plain)
Instance Method Summary collapse
-
#initialize ⇒ PlaintextHandler
constructor
A new instance of PlaintextHandler.
- #text(file) ⇒ Object
Methods inherited from FileHandler
Constructor Details
#initialize ⇒ PlaintextHandler
Returns a new instance of PlaintextHandler.
6 7 8 |
# File 'lib/text_extractor/file_handler/plaintext_handler.rb', line 6 def initialize @content_types = CONTENT_TYPES end |
Instance Method Details
#text(file) ⇒ Object
10 11 12 |
# File 'lib/text_extractor/file_handler/plaintext_handler.rb', line 10 def text(file) TextExtractor::CodesetUtil.to_utf8 IO.read(file), 'UTF-8' end |