Class: Mindee::PageOptions
- Inherits:
-
Object
- Object
- Mindee::PageOptions
- Defined in:
- lib/mindee/client.rb
Overview
Class for page options in parse calls.
Instance Attribute Summary collapse
-
#on_min_pages ⇒ Object
Apply the operation only if the document has at least this many pages.
-
#operation ⇒ Object
Returns the value of attribute operation.
-
#page_indexes ⇒ Object
Zero-based list of page indexes.
Instance Method Summary collapse
-
#initialize(params: {}) ⇒ PageOptions
constructor
A new instance of PageOptions.
Constructor Details
#initialize(params: {}) ⇒ PageOptions
Returns a new instance of PageOptions.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/mindee/client.rb', line 25 def initialize(params: {}) params ||= {} params = params.transform_keys(&:to_sym) @page_indexes = params.fetch( :page_indexes, [] # : Array[Integer] ) @operation = params.fetch(:operation, :KEEP_ONLY) @on_min_pages = params.fetch(:on_min_pages, nil) end |
Instance Attribute Details
#on_min_pages ⇒ Object
Apply the operation only if the document has at least this many pages.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/mindee/client.rb', line 22 class PageOptions attr_accessor :page_indexes, :operation, :on_min_pages def initialize(params: {}) params ||= {} params = params.transform_keys(&:to_sym) @page_indexes = params.fetch( :page_indexes, [] # : Array[Integer] ) @operation = params.fetch(:operation, :KEEP_ONLY) @on_min_pages = params.fetch(:on_min_pages, nil) end end |
#operation ⇒ Object
Returns the value of attribute operation.
23 24 25 |
# File 'lib/mindee/client.rb', line 23 def operation @operation end |
#page_indexes ⇒ Object
Zero-based list of page indexes.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/mindee/client.rb', line 22 class PageOptions attr_accessor :page_indexes, :operation, :on_min_pages def initialize(params: {}) params ||= {} params = params.transform_keys(&:to_sym) @page_indexes = params.fetch( :page_indexes, [] # : Array[Integer] ) @operation = params.fetch(:operation, :KEEP_ONLY) @on_min_pages = params.fetch(:on_min_pages, nil) end end |