Method: Selenium::WebDriver::Proxy.json_create

Defined in:
lib/selenium/webdriver/common/proxy.rb

.json_create(data) ⇒ Object



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/selenium/webdriver/common/proxy.rb', line 103

def json_create(data)
  return if data['proxyType'] == 'UNSPECIFIED'

  proxy = new

  proxy.type        = data['proxyType'].downcase.to_sym if data.has_key? 'proxyType'
  proxy.ftp         = data['ftpProxy'] if data.has_key? 'ftpProxy'
  proxy.http        = data['httpProxy'] if data.has_key? 'httpProxy'
  proxy.no_proxy    = data['noProxy'] if data.has_key? 'noProxy'
  proxy.pac         = data['proxyAutoconfigUrl'] if data.has_key? 'proxyAutoconfigUrl'
  proxy.ssl         = data['sslProxy'] if data.has_key? 'sslProxy'
  proxy.auto_detect = data['autodetect'] if data.has_key? 'autodetect'

  proxy
end