Class: Mindee::Input::Source::PathInputSource

Inherits:
LocalInputSource show all
Defined in:
lib/mindee/input/sources/path_input_source.rb

Overview

Load a document from a path.

Instance Attribute Summary

Attributes inherited from LocalInputSource

#file_mimetype, #filename, #io_stream

Instance Method Summary collapse

Methods inherited from LocalInputSource

#compress!, #count_pages, #pdf?, #process_pdf, #read_contents, #rescue_broken_pdf, #source_text?, #write_to_file

Constructor Details

#initialize(filepath, repair_pdf: false) ⇒ PathInputSource

Returns a new instance of PathInputSource.

Parameters:

  • filepath (String)
  • repair_pdf (bool) (defaults to: false)


13
14
15
16
# File 'lib/mindee/input/sources/path_input_source.rb', line 13

def initialize(filepath, repair_pdf: false)
  io_stream = File.open(filepath, 'rb')
  super(io_stream, File.basename(filepath), repair_pdf: repair_pdf)
end