Module: TestingBot::Resources::Tunnels

Included in:
Api
Defined in:
lib/testingbot/resources/tunnels.rb

Overview

Endpoints under /tunnel.

Instance Method Summary collapse

Instance Method Details

#delete_tunnel(tunnel_identifier = nil) ⇒ Object

Delete a tunnel by ID, or the active tunnel when called without an argument.



15
16
17
# File 'lib/testingbot/resources/tunnels.rb', line 15

def delete_tunnel(tunnel_identifier = nil)
  delete(tunnel_identifier ? "/tunnel/#{escape(tunnel_identifier)}" : "/tunnel")
end

#get_tunnel(tunnel_identifier = nil) ⇒ Object

Fetch the active tunnel, or a specific tunnel by numeric ID.



10
11
12
# File 'lib/testingbot/resources/tunnels.rb', line 10

def get_tunnel(tunnel_identifier = nil)
  tunnel_identifier ? get("/tunnel/#{escape(tunnel_identifier)}") : get("/tunnel")
end

#get_tunnelsObject



5
6
7
# File 'lib/testingbot/resources/tunnels.rb', line 5

def get_tunnels
  get("/tunnel/list")
end