Class: TxtContentExtractor
- Inherits:
-
Object
- Object
- TxtContentExtractor
- Defined in:
- lib/content_extractors/text_content_extractor.rb
Defined Under Namespace
Classes: 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) ⇒ TxtContentExtractor
constructor
A new instance of TxtContentExtractor.
Constructor Details
#initialize(file) ⇒ TxtContentExtractor
Returns a new instance of TxtContentExtractor.
15 16 17 |
# File 'lib/content_extractors/text_content_extractor.rb', line 15 def initialize(file) @file = file end |
Instance Attribute Details
#page_count ⇒ Object (readonly)
Returns the value of attribute page_count.
6 7 8 |
# File 'lib/content_extractors/text_content_extractor.rb', line 6 def page_count @page_count end |
Instance Method Details
#call ⇒ Object
19 20 21 22 23 |
# File 'lib/content_extractors/text_content_extractor.rb', line 19 def call extract_content rescue StandardError => e raise ExtractionError, "Content extraction failed: #{e.}" end |