Class: Mindee::V2::Product::Split::SplitRange
- Inherits:
-
Object
- Object
- Mindee::V2::Product::Split::SplitRange
- Defined in:
- lib/mindee/v2/product/split/split_range.rb
Overview
Split inference result.
Instance Attribute Summary collapse
-
#document_type ⇒ String
readonly
The document type, as identified on given classification values.
-
#page_range ⇒ Array<Integer>
readonly
0-based page indexes, where the first integer indicates the start page and the second integer indicates the end page.
Instance Method Summary collapse
-
#extract_from_file(input_source) ⇒ PDF::ExtractedPDF
Apply the split range inference to a file and return a single extracted PDF.
-
#initialize(server_response) ⇒ SplitRange
constructor
A new instance of SplitRange.
-
#to_s ⇒ String
String representation.
Constructor Details
#initialize(server_response) ⇒ SplitRange
Returns a new instance of SplitRange.
16 17 18 19 |
# File 'lib/mindee/v2/product/split/split_range.rb', line 16 def initialize(server_response) @page_range = server_response['page_range'] @document_type = server_response['document_type'] end |
Instance Attribute Details
#document_type ⇒ String (readonly)
Returns The document type, as identified on given classification values.
13 14 15 |
# File 'lib/mindee/v2/product/split/split_range.rb', line 13 def document_type @document_type end |
#page_range ⇒ Array<Integer> (readonly)
Returns 0-based page indexes, where the first integer indicates the start page and the second integer indicates the end page.
11 12 13 |
# File 'lib/mindee/v2/product/split/split_range.rb', line 11 def page_range @page_range end |
Instance Method Details
#extract_from_file(input_source) ⇒ PDF::ExtractedPDF
Apply the split range inference to a file and return a single extracted PDF.
31 32 33 |
# File 'lib/mindee/v2/product/split/split_range.rb', line 31 def extract_from_file(input_source) FileOperation::Split.extract_single_split(input_source, @page_range) end |
#to_s ⇒ String
String representation.
23 24 25 |
# File 'lib/mindee/v2/product/split/split_range.rb', line 23 def to_s "* :Page Range: #{@page_range}\n :Document Type: #{@document_type}" end |