Class: HttpMimic::Configuration
- Inherits:
-
Object
- Object
- HttpMimic::Configuration
- Defined in:
- lib/http_mimic/configuration.rb
Instance Attribute Summary collapse
-
#auto_download ⇒ Object
Webdrivers-like auto download and driver management settings.
-
#auto_fallback ⇒ Object
Returns the value of attribute auto_fallback.
-
#binary_path ⇒ Object
Returns the value of attribute binary_path.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#default_connect_timeout ⇒ Object
Returns the value of attribute default_connect_timeout.
-
#default_impersonate ⇒ Object
Returns the value of attribute default_impersonate.
-
#default_timeout ⇒ Object
Returns the value of attribute default_timeout.
-
#driver_version ⇒ Object
Returns the value of attribute driver_version.
-
#fallback_to_curl ⇒ Object
Returns the value of attribute fallback_to_curl.
-
#follow_redirects ⇒ Object
Returns the value of attribute follow_redirects.
-
#github_repo ⇒ Object
Returns the value of attribute github_repo.
-
#install_dir ⇒ Object
Returns the value of attribute install_dir.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#max_redirects ⇒ Object
Returns the value of attribute max_redirects.
-
#mode ⇒ Object
Multi-strategy and smart auto-fallback settings.
-
#raise_on_error ⇒ Object
Returns the value of attribute raise_on_error.
-
#retry_statuses ⇒ Object
Returns the value of attribute retry_statuses.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/http_mimic/configuration.rb', line 27 def initialize @default_impersonate = 'chrome131' @binary_path = nil @fallback_to_curl = true @default_timeout = 30 @default_connect_timeout = 10 @follow_redirects = true @max_redirects = 10 @raise_on_error = false @logger = nil @debug = false # Multi-strategy defaults: :auto seamlessly falls back between impersonate and curl @mode = :auto @auto_fallback = true @retry_statuses = [403, 429, 503] # Enable automatic downloading of curl-impersonate driver (lexiforest) by default @auto_download = true @driver_version = 'v2.1.1' @install_dir = File.('~/.http_mimic/bin') @github_repo = 'lexiforest/curl-impersonate' end |
Instance Attribute Details
#auto_download ⇒ Object
Webdrivers-like auto download and driver management settings
22 23 24 |
# File 'lib/http_mimic/configuration.rb', line 22 def auto_download @auto_download end |
#auto_fallback ⇒ Object
Returns the value of attribute auto_fallback.
18 19 20 |
# File 'lib/http_mimic/configuration.rb', line 18 def auto_fallback @auto_fallback end |
#binary_path ⇒ Object
Returns the value of attribute binary_path.
6 7 8 |
# File 'lib/http_mimic/configuration.rb', line 6 def binary_path @binary_path end |
#debug ⇒ Object
Returns the value of attribute debug.
14 15 16 |
# File 'lib/http_mimic/configuration.rb', line 14 def debug @debug end |
#default_connect_timeout ⇒ Object
Returns the value of attribute default_connect_timeout.
9 10 11 |
# File 'lib/http_mimic/configuration.rb', line 9 def default_connect_timeout @default_connect_timeout end |
#default_impersonate ⇒ Object
Returns the value of attribute default_impersonate.
5 6 7 |
# File 'lib/http_mimic/configuration.rb', line 5 def default_impersonate @default_impersonate end |
#default_timeout ⇒ Object
Returns the value of attribute default_timeout.
8 9 10 |
# File 'lib/http_mimic/configuration.rb', line 8 def default_timeout @default_timeout end |
#driver_version ⇒ Object
Returns the value of attribute driver_version.
23 24 25 |
# File 'lib/http_mimic/configuration.rb', line 23 def driver_version @driver_version end |
#fallback_to_curl ⇒ Object
Returns the value of attribute fallback_to_curl.
7 8 9 |
# File 'lib/http_mimic/configuration.rb', line 7 def fallback_to_curl @fallback_to_curl end |
#follow_redirects ⇒ Object
Returns the value of attribute follow_redirects.
10 11 12 |
# File 'lib/http_mimic/configuration.rb', line 10 def follow_redirects @follow_redirects end |
#github_repo ⇒ Object
Returns the value of attribute github_repo.
25 26 27 |
# File 'lib/http_mimic/configuration.rb', line 25 def github_repo @github_repo end |
#install_dir ⇒ Object
Returns the value of attribute install_dir.
24 25 26 |
# File 'lib/http_mimic/configuration.rb', line 24 def install_dir @install_dir end |
#logger ⇒ Object
Returns the value of attribute logger.
13 14 15 |
# File 'lib/http_mimic/configuration.rb', line 13 def logger @logger end |
#max_redirects ⇒ Object
Returns the value of attribute max_redirects.
11 12 13 |
# File 'lib/http_mimic/configuration.rb', line 11 def max_redirects @max_redirects end |
#mode ⇒ Object
Multi-strategy and smart auto-fallback settings
17 18 19 |
# File 'lib/http_mimic/configuration.rb', line 17 def mode @mode end |
#raise_on_error ⇒ Object
Returns the value of attribute raise_on_error.
12 13 14 |
# File 'lib/http_mimic/configuration.rb', line 12 def raise_on_error @raise_on_error end |
#retry_statuses ⇒ Object
Returns the value of attribute retry_statuses.
19 20 21 |
# File 'lib/http_mimic/configuration.rb', line 19 def retry_statuses @retry_statuses end |