Method: HttpUtilities::Http::ProxySupport#set_from_array

Defined in:
lib/http_utilities/http/proxy_support.rb

#set_from_array(proxy_opts) ⇒ Object



61
62
63
64
65
66
67
68
69
70
71
# File 'lib/http_utilities/http/proxy_support.rb', line 61

def set_from_array(proxy_opts)
  item                          =   proxy_opts.sample
  
  if item.is_a?(String)
    set_from_string(item)
  elsif item.is_a?(Hash) && !item.empty?
    set_from_hash(item)
  elsif proxy_model_defined? && item.is_a?(::Proxy)
    set_from_object(item)
  end
end