Class: ProxiClean::Client
- Inherits:
-
Object
- Object
- ProxiClean::Client
- Defined in:
- lib/proxi_clean/client.rb
Instance Attribute Summary collapse
-
#public_ip ⇒ Object
readonly
Returns the value of attribute public_ip.
Instance Method Summary collapse
-
#initialize ⇒ Client
constructor
A new instance of Client.
- #works?(proxy_uri) ⇒ Boolean
Constructor Details
#initialize ⇒ Client
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_ip ⇒ Object (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
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 |