Class: DocxContentExtractor
- Inherits:
-
Object
- Object
- DocxContentExtractor
- Defined in:
- lib/content_extractors/docx_content_extractor.rb
Defined Under Namespace
Classes: DocxProcessingError, ExtractionError, FileDownloadError, FileReadError
Constant Summary collapse
- WORDS_PER_PAGE =
500
Instance Attribute Summary collapse
-
#page_count ⇒ Object
readonly
Returns the value of attribute page_count.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(file) ⇒ DocxContentExtractor
constructor
A new instance of DocxContentExtractor.
Constructor Details
#initialize(file) ⇒ DocxContentExtractor
Returns a new instance of DocxContentExtractor.
17 18 19 |
# File 'lib/content_extractors/docx_content_extractor.rb', line 17 def initialize(file) @file = file end |
Instance Attribute Details
#page_count ⇒ Object (readonly)
Returns the value of attribute page_count.
7 8 9 |
# File 'lib/content_extractors/docx_content_extractor.rb', line 7 def page_count @page_count end |
Instance Method Details
#call ⇒ Object
21 22 23 24 25 |
# File 'lib/content_extractors/docx_content_extractor.rb', line 21 def call extract_content rescue StandardError => e raise ExtractionError, "Content extraction failed: #{e.}" end |