Module: Thumblemonks::Indico
- Defined in:
- lib/thumblemonks/indico/io_helpers.rb,
lib/thumblemonks/indico/text_extractor.rb,
lib/thumblemonks/indico/extracted_document.rb,
lib/thumblemonks/indico/text_extractor/handlers/pdf_document.rb,
lib/thumblemonks/indico/text_extractor/handlers/rtf_document.rb,
lib/thumblemonks/indico/text_extractor/handlers/html_document.rb,
lib/thumblemonks/indico/text_extractor/handlers/text_document.rb,
lib/thumblemonks/indico/text_extractor/handlers/word_document.rb
Defined Under Namespace
Modules: IOHelpers Classes: ExtractedDocument, HTMLDocument, PDFDocument, RTFDocument, TextDocument, UnknownTypeError, WordDocument
Class Attribute Summary collapse
-
.document_handlers ⇒ Object
Returns the value of attribute document_handlers.
-
.known_types ⇒ Object
Returns the value of attribute known_types.
Class Method Summary collapse
- .add_handler(handler_class, options) ⇒ Object
- .build_document(options) ⇒ Object
-
.load_handlers! ⇒ Object
Called from an initializer in config/initializers.
- .type_known?(mime_type) ⇒ Boolean
Class Attribute Details
.document_handlers ⇒ Object
Returns the value of attribute document_handlers.
6 7 8 |
# File 'lib/thumblemonks/indico/text_extractor.rb', line 6 def document_handlers @document_handlers end |
.known_types ⇒ Object
Returns the value of attribute known_types.
6 7 8 |
# File 'lib/thumblemonks/indico/text_extractor.rb', line 6 def known_types @known_types end |
Class Method Details
.add_handler(handler_class, options) ⇒ Object
23 24 25 26 |
# File 'lib/thumblemonks/indico/text_extractor.rb', line 23 def self.add_handler(handler_class, ) document_handlers.merge!([:type] => handler_class) known_types.merge!([:type] => Array([:extensions])) end |
.build_document(options) ⇒ Object
14 15 16 |
# File 'lib/thumblemonks/indico/text_extractor.rb', line 14 def self.build_document() pick_document_class([:type]).new([:content]) end |
.load_handlers! ⇒ Object
Called from an initializer in config/initializers
19 20 21 |
# File 'lib/thumblemonks/indico/text_extractor.rb', line 19 def self.load_handlers! Dir["#{handler_dir}/handlers/*_document.rb"].each {|handler| require(handler)} end |
.type_known?(mime_type) ⇒ Boolean
10 11 12 |
# File 'lib/thumblemonks/indico/text_extractor.rb', line 10 def self.type_known?(mime_type) known_types.has_key?(mime_type) end |