Class: HttpProxyPool::Proxy
- Inherits:
-
Object
- Object
- HttpProxyPool::Proxy
- Defined in:
- lib/http_proxy_pool/proxy.rb
Instance Attribute Summary collapse
-
#added_time ⇒ Object
Returns the value of attribute added_time.
-
#ip ⇒ Object
Returns the value of attribute ip.
-
#last_access_time ⇒ Object
Returns the value of attribute last_access_time.
-
#nation ⇒ Object
Returns the value of attribute nation.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#province ⇒ Object
Returns the value of attribute province.
-
#proxy_level ⇒ Object
Returns the value of attribute proxy_level.
-
#proxy_type ⇒ Object
Returns the value of attribute proxy_type.
-
#speed ⇒ Object
Returns the value of attribute speed.
-
#src_from ⇒ Object
Returns the value of attribute src_from.
-
#try_times ⇒ Object
Returns the value of attribute try_times.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Proxy
constructor
A new instance of Proxy.
- #to_arr ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Proxy
Returns a new instance of Proxy.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/http_proxy_pool/proxy.rb', line 19 def initialize(args = {}) @ip = args[:ip] @port = args[:port] @username = args[:username] || '' @password = args[:password] || '' @proxy_type = args[:proxy_type] @proxy_level= args[:proxy_level] @speed = args[:speed] @added_time = args[:added_time] @last_access= args[:last_access] @nation = args[:nation] @province = args[:province] @src_from = args[:src_from] @try_times = args[:try_times] || 0 end |
Instance Attribute Details
#added_time ⇒ Object
Returns the value of attribute added_time.
5 6 7 |
# File 'lib/http_proxy_pool/proxy.rb', line 5 def added_time @added_time end |
#ip ⇒ Object
Returns the value of attribute ip.
5 6 7 |
# File 'lib/http_proxy_pool/proxy.rb', line 5 def ip @ip end |
#last_access_time ⇒ Object
Returns the value of attribute last_access_time.
5 6 7 |
# File 'lib/http_proxy_pool/proxy.rb', line 5 def last_access_time @last_access_time end |
#nation ⇒ Object
Returns the value of attribute nation.
5 6 7 |
# File 'lib/http_proxy_pool/proxy.rb', line 5 def nation @nation end |
#password ⇒ Object
Returns the value of attribute password.
5 6 7 |
# File 'lib/http_proxy_pool/proxy.rb', line 5 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
5 6 7 |
# File 'lib/http_proxy_pool/proxy.rb', line 5 def port @port end |
#province ⇒ Object
Returns the value of attribute province.
5 6 7 |
# File 'lib/http_proxy_pool/proxy.rb', line 5 def province @province end |
#proxy_level ⇒ Object
Returns the value of attribute proxy_level.
5 6 7 |
# File 'lib/http_proxy_pool/proxy.rb', line 5 def proxy_level @proxy_level end |
#proxy_type ⇒ Object
Returns the value of attribute proxy_type.
5 6 7 |
# File 'lib/http_proxy_pool/proxy.rb', line 5 def proxy_type @proxy_type end |
#speed ⇒ Object
Returns the value of attribute speed.
5 6 7 |
# File 'lib/http_proxy_pool/proxy.rb', line 5 def speed @speed end |
#src_from ⇒ Object
Returns the value of attribute src_from.
5 6 7 |
# File 'lib/http_proxy_pool/proxy.rb', line 5 def src_from @src_from end |
#try_times ⇒ Object
Returns the value of attribute try_times.
5 6 7 |
# File 'lib/http_proxy_pool/proxy.rb', line 5 def try_times @try_times end |
#username ⇒ Object
Returns the value of attribute username.
5 6 7 |
# File 'lib/http_proxy_pool/proxy.rb', line 5 def username @username end |
Instance Method Details
#to_arr ⇒ Object
35 36 37 |
# File 'lib/http_proxy_pool/proxy.rb', line 35 def to_arr [@ip, @port, @proxy_type, @proxy_level, @nation, @province] end |
#to_s ⇒ Object
39 40 41 |
# File 'lib/http_proxy_pool/proxy.rb', line 39 def to_s "#{@ip}\t#{@port}" end |