Class: TorManager::IpAddressControl
- Inherits:
-
Object
- Object
- TorManager::IpAddressControl
- Defined in:
- lib/tormanager/ip_address_control.rb
Instance Attribute Summary collapse
-
#ip ⇒ Object
Returns the value of attribute ip.
Instance Method Summary collapse
- #get_ip ⇒ Object
- #get_new_ip ⇒ Object
-
#initialize(params = {}) ⇒ IpAddressControl
constructor
A new instance of IpAddressControl.
Constructor Details
#initialize(params = {}) ⇒ IpAddressControl
9 10 11 12 13 14 |
# File 'lib/tormanager/ip_address_control.rb', line 9 def initialize params={} @tor_process = params.fetch(:tor_process, nil) @tor_proxy = params.fetch(:tor_proxy, nil) @ip = nil @endpoint_change_attempts = 5 end |
Instance Attribute Details
#ip ⇒ Object
Returns the value of attribute ip.
7 8 9 |
# File 'lib/tormanager/ip_address_control.rb', line 7 def ip @ip end |
Instance Method Details
#get_ip ⇒ Object
16 17 18 19 |
# File 'lib/tormanager/ip_address_control.rb', line 16 def get_ip ensure_tor_is_available @ip = tor_endpoint_ip end |
#get_new_ip ⇒ Object
21 22 23 24 |
# File 'lib/tormanager/ip_address_control.rb', line 21 def get_new_ip ensure_tor_is_available get_new_tor_endpoint_ip end |