Class: BlackStack::Bots::Bot
- Inherits:
-
Object
- Object
- BlackStack::Bots::Bot
- Defined in:
- lib/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#ip ⇒ Object
ip address of proxy.
-
#password ⇒ Object
password of proxy.
-
#port_index ⇒ Object
index of the port.
-
#ports ⇒ Object
array of ports.
-
#user ⇒ Object
user of proxy.
Instance Method Summary collapse
-
#initialize(h) ⇒ Bot
constructor
A new instance of Bot.
-
#proxy? ⇒ Boolean
return true if the bot is using a proxy.
Constructor Details
#initialize(h) ⇒ Bot
Returns a new instance of Bot.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/base.rb', line 10 def initialize(h) # array of numbers from 4000 to 4249 if h self.ip = h[:ip] self.user = h[:user] self.password = h[:password] self.ports = (h[:port_from]..h[:port_to]).to_a else self.ports = [] end self.port_index = -1 end |
Instance Attribute Details
#ip ⇒ Object
ip address of proxy
4 5 6 |
# File 'lib/base.rb', line 4 def ip @ip end |
#password ⇒ Object
password of proxy
6 7 8 |
# File 'lib/base.rb', line 6 def password @password end |
#port_index ⇒ Object
index of the port
8 9 10 |
# File 'lib/base.rb', line 8 def port_index @port_index end |
#ports ⇒ Object
array of ports
7 8 9 |
# File 'lib/base.rb', line 7 def ports @ports end |
#user ⇒ Object
user of proxy
5 6 7 |
# File 'lib/base.rb', line 5 def user @user end |
Instance Method Details
#proxy? ⇒ Boolean
return true if the bot is using a proxy
24 25 26 |
# File 'lib/base.rb', line 24 def proxy? !self.ip.nil? end |