Class: Mindee::ParseOptions
- Inherits:
-
Object
- Object
- Mindee::ParseOptions
- Defined in:
- lib/mindee/client.rb
Overview
Class for configuration options in parse calls.
Instance Attribute Summary collapse
-
#all_words ⇒ Object
Returns the value of attribute all_words.
-
#close_file ⇒ Object
Returns the value of attribute close_file.
-
#cropper ⇒ Object
Returns the value of attribute cropper.
-
#delay_sec ⇒ Object
Delay between polling attempts.
-
#full_text ⇒ Object
Returns the value of attribute full_text.
-
#initial_delay_sec ⇒ Object
Initial delay before polling.
-
#max_retries ⇒ Object
Maximum number of retries.
-
#page_options ⇒ Object
Returns the value of attribute page_options.
Instance Method Summary collapse
-
#initialize(params: {}) ⇒ ParseOptions
constructor
A new instance of ParseOptions.
Constructor Details
#initialize(params: {}) ⇒ ParseOptions
Returns a new instance of ParseOptions.
60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/mindee/client.rb', line 60 def initialize(params: {}) params = params.transform_keys(&:to_sym) @all_words = params.fetch(:all_words, false) @full_text = params.fetch(:full_text, false) @close_file = params.fetch(:close_file, true) = params.fetch(:page_options, nil) = PageOptions.new(params: ) unless .is_a?(PageOptions) @page_options = @cropper = params.fetch(:cropper, false) @initial_delay_sec = params.fetch(:initial_delay_sec, 2) @delay_sec = params.fetch(:delay_sec, 1.5) @max_retries = params.fetch(:max_retries, 80) end |
Instance Attribute Details
#all_words ⇒ Object
Returns the value of attribute all_words.
57 58 59 |
# File 'lib/mindee/client.rb', line 57 def all_words @all_words end |
#close_file ⇒ Object
Returns the value of attribute close_file.
57 58 59 |
# File 'lib/mindee/client.rb', line 57 def close_file @close_file end |
#cropper ⇒ Object
Returns the value of attribute cropper.
57 58 59 |
# File 'lib/mindee/client.rb', line 57 def cropper @cropper end |
#delay_sec ⇒ Object
Delay between polling attempts. Defaults to 1.5.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/mindee/client.rb', line 56 class ParseOptions attr_accessor :all_words, :full_text, :close_file, :page_options, :cropper, :initial_delay_sec, :delay_sec, :max_retries def initialize(params: {}) params = params.transform_keys(&:to_sym) @all_words = params.fetch(:all_words, false) @full_text = params.fetch(:full_text, false) @close_file = params.fetch(:close_file, true) = params.fetch(:page_options, nil) = PageOptions.new(params: ) unless .is_a?(PageOptions) @page_options = @cropper = params.fetch(:cropper, false) @initial_delay_sec = params.fetch(:initial_delay_sec, 2) @delay_sec = params.fetch(:delay_sec, 1.5) @max_retries = params.fetch(:max_retries, 80) end end |
#full_text ⇒ Object
Returns the value of attribute full_text.
57 58 59 |
# File 'lib/mindee/client.rb', line 57 def full_text @full_text end |
#initial_delay_sec ⇒ Object
Initial delay before polling. Defaults to 2.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/mindee/client.rb', line 56 class ParseOptions attr_accessor :all_words, :full_text, :close_file, :page_options, :cropper, :initial_delay_sec, :delay_sec, :max_retries def initialize(params: {}) params = params.transform_keys(&:to_sym) @all_words = params.fetch(:all_words, false) @full_text = params.fetch(:full_text, false) @close_file = params.fetch(:close_file, true) = params.fetch(:page_options, nil) = PageOptions.new(params: ) unless .is_a?(PageOptions) @page_options = @cropper = params.fetch(:cropper, false) @initial_delay_sec = params.fetch(:initial_delay_sec, 2) @delay_sec = params.fetch(:delay_sec, 1.5) @max_retries = params.fetch(:max_retries, 80) end end |
#max_retries ⇒ Object
Maximum number of retries. Defaults to 80.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/mindee/client.rb', line 56 class ParseOptions attr_accessor :all_words, :full_text, :close_file, :page_options, :cropper, :initial_delay_sec, :delay_sec, :max_retries def initialize(params: {}) params = params.transform_keys(&:to_sym) @all_words = params.fetch(:all_words, false) @full_text = params.fetch(:full_text, false) @close_file = params.fetch(:close_file, true) = params.fetch(:page_options, nil) = PageOptions.new(params: ) unless .is_a?(PageOptions) @page_options = @cropper = params.fetch(:cropper, false) @initial_delay_sec = params.fetch(:initial_delay_sec, 2) @delay_sec = params.fetch(:delay_sec, 1.5) @max_retries = params.fetch(:max_retries, 80) end end |
#page_options ⇒ Object
Returns the value of attribute page_options.
57 58 59 |
# File 'lib/mindee/client.rb', line 57 def @page_options end |