Class: Selenium::WebDriver::ClientConfig
- Inherits:
-
Object
- Object
- Selenium::WebDriver::ClientConfig
- Defined in:
- lib/selenium/webdriver/common/client_config.rb
Overview
Configuration for HTTP clients.
Class Attribute Summary collapse
-
.default_extra_headers ⇒ Object
Returns the value of attribute default_extra_headers.
- .default_user_agent ⇒ Object
Instance Attribute Summary collapse
- #extra_headers ⇒ Object
-
#max_redirects ⇒ Object
Returns the value of attribute max_redirects.
-
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
#proxy ⇒ Object
Returns the value of attribute proxy.
-
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
-
#server_url ⇒ Object
Returns the value of attribute server_url.
- #user_agent ⇒ Object
Instance Method Summary collapse
-
#initialize(open_timeout: 60, read_timeout: 120, max_redirects: 20, proxy: nil, extra_headers: nil, user_agent: nil, server_url: nil) ⇒ ClientConfig
constructor
A new instance of ClientConfig.
Constructor Details
#initialize(open_timeout: 60, read_timeout: 120, max_redirects: 20, proxy: nil, extra_headers: nil, user_agent: nil, server_url: nil) ⇒ ClientConfig
Returns a new instance of ClientConfig.
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/selenium/webdriver/common/client_config.rb', line 51 def initialize(open_timeout: 60, read_timeout: 120, max_redirects: 20, proxy: nil, extra_headers: nil, user_agent: nil, server_url: nil) @open_timeout = open_timeout @read_timeout = read_timeout @max_redirects = max_redirects @proxy = proxy || proxy_from_environment @extra_headers = extra_headers @user_agent = user_agent self.server_url = server_url end |
Class Attribute Details
.default_extra_headers ⇒ Object
Returns the value of attribute default_extra_headers.
30 31 32 |
# File 'lib/selenium/webdriver/common/client_config.rb', line 30 def default_extra_headers @default_extra_headers end |
Instance Attribute Details
#extra_headers ⇒ Object
71 72 73 |
# File 'lib/selenium/webdriver/common/client_config.rb', line 71 def extra_headers @extra_headers || self.class.default_extra_headers end |
#max_redirects ⇒ Object
Returns the value of attribute max_redirects.
38 39 40 |
# File 'lib/selenium/webdriver/common/client_config.rb', line 38 def max_redirects @max_redirects end |
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
38 39 40 |
# File 'lib/selenium/webdriver/common/client_config.rb', line 38 def open_timeout @open_timeout end |
#proxy ⇒ Object
Returns the value of attribute proxy.
38 39 40 |
# File 'lib/selenium/webdriver/common/client_config.rb', line 38 def proxy @proxy end |
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
38 39 40 |
# File 'lib/selenium/webdriver/common/client_config.rb', line 38 def read_timeout @read_timeout end |
#server_url ⇒ Object
Returns the value of attribute server_url.
40 41 42 |
# File 'lib/selenium/webdriver/common/client_config.rb', line 40 def server_url @server_url end |
#user_agent ⇒ Object
67 68 69 |
# File 'lib/selenium/webdriver/common/client_config.rb', line 67 def user_agent @user_agent || self.class.default_user_agent end |