Class: Mindee::Input::Source::PathInputSource
- Inherits:
-
LocalInputSource
- Object
- LocalInputSource
- Mindee::Input::Source::PathInputSource
- Defined in:
- lib/mindee/input/sources.rb
Overview
Load a document from a path.
Instance Attribute Summary
Attributes inherited from LocalInputSource
#file_mimetype, #filename, #io_stream
Instance Method Summary collapse
-
#initialize(filepath, fix_pdf: false) ⇒ PathInputSource
constructor
A new instance of PathInputSource.
Methods inherited from LocalInputSource
#compress!, #count_pdf_pages, #pdf?, #process_pdf, #read_document, #rescue_broken_pdf, #source_text?
Constructor Details
#initialize(filepath, fix_pdf: false) ⇒ PathInputSource
Returns a new instance of PathInputSource.
171 172 173 174 |
# File 'lib/mindee/input/sources.rb', line 171 def initialize(filepath, fix_pdf: false) io_stream = File.open(filepath, 'rb') super(io_stream, File.basename(filepath), fix_pdf: fix_pdf) end |