Class: Webhookapp::Tunnel::Client
- Inherits:
-
Object
- Object
- Webhookapp::Tunnel::Client
- Defined in:
- lib/webhookapp/tunnel/client.rb
Instance Method Summary collapse
-
#initialize(local_port, hook_id, client_id, username, password) ⇒ Client
constructor
A new instance of Client.
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(local_port, hook_id, client_id, username, password) ⇒ Client
Returns a new instance of Client.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/webhookapp/tunnel/client.rb', line 8 def initialize(local_port, hook_id, client_id, username, password) raise ArgumentError, 'Unknown local port' unless local_port raise ArgumentError, 'Unknown hook' unless hook_id @connections = {} @local_port = local_port @hook_id = hook_id @client_id = client_id @username = username @password = password @details = nil @remote_port = nil @control = nil end |
Instance Method Details
#start ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/webhookapp/tunnel/client.rb', line 24 def start request_tunnel_details if @details start_tunnel else log "Closing due to lack of details" end end |
#stop ⇒ Object
33 34 35 |
# File 'lib/webhookapp/tunnel/client.rb', line 33 def stop @stopping = true end |