Class: WebScrapingAI::Configuration
- Inherits:
-
Object
- Object
- WebScrapingAI::Configuration
- Defined in:
- lib/webscraping_ai/configuration.rb
Constant Summary collapse
- DEFAULT_BASE_URL =
"https://api.webscraping.ai".freeze
- DEFAULT_TIMEOUT =
60- DEFAULT_OPEN_TIMEOUT =
10
Instance Attribute Summary collapse
-
#adapter ⇒ Object
Returns the value of attribute adapter.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 14 15 16 |
# File 'lib/webscraping_ai/configuration.rb', line 9 def initialize @api_key = ENV.fetch("WEBSCRAPING_AI_API_KEY", nil) @base_url = DEFAULT_BASE_URL @timeout = DEFAULT_TIMEOUT @open_timeout = DEFAULT_OPEN_TIMEOUT @adapter = nil @user_agent = "webscraping_ai-ruby/#{WebScrapingAI::VERSION}" end |
Instance Attribute Details
#adapter ⇒ Object
Returns the value of attribute adapter.
7 8 9 |
# File 'lib/webscraping_ai/configuration.rb', line 7 def adapter @adapter end |
#api_key ⇒ Object
Returns the value of attribute api_key.
7 8 9 |
# File 'lib/webscraping_ai/configuration.rb', line 7 def api_key @api_key end |
#base_url ⇒ Object
Returns the value of attribute base_url.
7 8 9 |
# File 'lib/webscraping_ai/configuration.rb', line 7 def base_url @base_url end |
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
7 8 9 |
# File 'lib/webscraping_ai/configuration.rb', line 7 def open_timeout @open_timeout end |
#timeout ⇒ Object
Returns the value of attribute timeout.
7 8 9 |
# File 'lib/webscraping_ai/configuration.rb', line 7 def timeout @timeout end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
7 8 9 |
# File 'lib/webscraping_ai/configuration.rb', line 7 def user_agent @user_agent end |