Class: ProxiClean::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/proxi_clean/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



7
8
9
# File 'lib/proxi_clean/client.rb', line 7

def initialize
  public_ip
end

Instance Attribute Details

#public_ipObject (readonly)

Returns the value of attribute public_ip.



5
6
7
# File 'lib/proxi_clean/client.rb', line 5

def public_ip
  @public_ip
end

Instance Method Details

#works?(proxy_uri) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
18
19
20
# File 'lib/proxi_clean/client.rb', line 11

def works?(proxy_uri)
  begin
    proxied_ip = proxied_ip(proxy_uri)
  rescue StandardError => e
    # If anything goes wrong, assuming the proxy is no good
    return false
  end

  public_ip != proxied_ip
end