Class: Proxtopus::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/proxtopus/proxy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host, port, protocol, country, anonymity) ⇒ Proxy

Returns a new instance of Proxy.



6
7
8
9
10
11
12
# File 'lib/proxtopus/proxy.rb', line 6

def initialize(host, port, protocol, country, anonymity)
  @host = host.to_s
  @port = port.to_i
  @protocol = protocol.to_s
  @country = country.to_s
  @anonymity = anonymity.to_s
end

Instance Attribute Details

#anonymityObject

Returns the value of attribute anonymity.



4
5
6
# File 'lib/proxtopus/proxy.rb', line 4

def anonymity
  @anonymity
end

#countryObject

Returns the value of attribute country.



4
5
6
# File 'lib/proxtopus/proxy.rb', line 4

def country
  @country
end

#hostObject

Returns the value of attribute host.



4
5
6
# File 'lib/proxtopus/proxy.rb', line 4

def host
  @host
end

#portObject

Returns the value of attribute port.



4
5
6
# File 'lib/proxtopus/proxy.rb', line 4

def port
  @port
end

#protocolObject

Returns the value of attribute protocol.



4
5
6
# File 'lib/proxtopus/proxy.rb', line 4

def protocol
  @protocol
end

Instance Method Details

#==(other) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/proxtopus/proxy.rb', line 14

def ==(other)
  if other.is_a?(Proxtopus::Proxy)
    if @host == other.host && @port == other.port && @protocol == other.protocol
      true
    else
      false
    end
  else
    false
  end
end