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
Returns a new instance of IpAddressControl.
8 9 10 11 12 13 |
# File 'lib/tormanager/ip_address_control.rb', line 8 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.
6 7 8 |
# File 'lib/tormanager/ip_address_control.rb', line 6 def ip @ip end |
Instance Method Details
#get_ip ⇒ Object
15 16 17 18 |
# File 'lib/tormanager/ip_address_control.rb', line 15 def get_ip ensure_tor_is_available @ip = tor_endpoint_ip end |
#get_new_ip ⇒ Object
20 21 22 23 |
# File 'lib/tormanager/ip_address_control.rb', line 20 def get_new_ip ensure_tor_is_available get_new_tor_endpoint_ip end |