Class: NgrokAPI::Services::TunnelsClient
- Inherits:
-
Object
- Object
- NgrokAPI::Services::TunnelsClient
- Defined in:
- lib/ngrokapi/services/tunnels_client.rb
Overview
Tunnels provide endpoints to access services exposed by a running ngrok
agent tunnel session or an SSH reverse tunnel session.
Constant Summary collapse
- LIST_PROPERTY =
The List Property from the resulting API for list calls
'tunnels'- PATH =
The API path for the requests
'/tunnels'
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(client:) ⇒ TunnelsClient
constructor
A new instance of TunnelsClient.
-
#list(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all online tunnels currently running on the account.
Constructor Details
#initialize(client:) ⇒ TunnelsClient
Returns a new instance of TunnelsClient.
18 19 20 |
# File 'lib/ngrokapi/services/tunnels_client.rb', line 18 def initialize(client:) @client = client end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
16 17 18 |
# File 'lib/ngrokapi/services/tunnels_client.rb', line 16 def client @client end |
Instance Method Details
#list(before_id: nil, limit: nil, url: nil) ⇒ NgrokAPI::Models::Listable
List all online tunnels currently running on the account.
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/ngrokapi/services/tunnels_client.rb', line 31 def list( before_id: nil, limit: nil, url: nil ) result = @client.list( before_id: before_id, limit: limit, url: url, path: PATH ) NgrokAPI::Models::Listable.new( client: self, result: result, list_property: LIST_PROPERTY, klass: NgrokAPI::Models::Tunnel ) end |