Class: ProxyAPI::AvailableProxy
- Inherits:
-
Object
- Object
- ProxyAPI::AvailableProxy
- Defined in:
- app/lib/proxy_api/available_proxy.rb
Constant Summary collapse
- HTTP_ERRORS =
[ EOFError, Errno::ECONNRESET, Errno::EINVAL, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError, Timeout::Error, ProxyAPI::ProxyException ].freeze
Instance Method Summary collapse
- #available? ⇒ Boolean
-
#initialize(args) ⇒ AvailableProxy
constructor
A new instance of AvailableProxy.
Constructor Details
#initialize(args) ⇒ AvailableProxy
Returns a new instance of AvailableProxy.
14 15 16 |
# File 'app/lib/proxy_api/available_proxy.rb', line 14 def initialize(args) @args = args end |
Instance Method Details
#available? ⇒ Boolean
18 19 20 21 22 23 24 25 |
# File 'app/lib/proxy_api/available_proxy.rb', line 18 def available? begin return true if has_scap_feature? && minimum_version rescue *HTTP_ERRORS return false end false end |