Class: NgrokAPI::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/ngrokapi/client.rb

Overview

Low-level api client for communicating with Ngrok's HTTP API. Use this object to instantiate your clients.

Instance Method Summary collapse

Constructor Details

#initialize(api_key:, base_url: 'https://api.ngrok.com') ⇒ Client

Returns a new instance of Client.



8
9
10
11
12
13
# File 'lib/ngrokapi/client.rb', line 8

def initialize(
  api_key:,
  base_url: 'https://api.ngrok.com'
)
  @client = NgrokAPI::HttpClient.new(api_key: api_key, base_url: base_url)
end

Instance Method Details

#api_keysNgrokAPI::Services::ApiKeysClient

Creates and returns an instance of a NgrokAPI::Services::ApiKeysClient



19
20
21
# File 'lib/ngrokapi/client.rb', line 19

def api_keys
  @_api_keys ||= NgrokAPI::Services::ApiKeysClient.new(client: @client)
end

#endpoint_configurationsNgrokAPI::Services::EndpointConfigurationsClient

Creates and returns an instance of a NgrokAPI::Services::EndpointConfigurationsClient



27
28
29
30
31
# File 'lib/ngrokapi/client.rb', line 27

def endpoint_configurations
  @_endpoint_configurations ||= NgrokAPI::Services::EndpointConfigurationsClient.new(
    client: @client
  )
end

#reserved_domainsNgrokAPI::Services::ReservedDomainsClient

Creates and returns an instance of a NgrokAPI::Services::ReservedDomainsClient



37
38
39
# File 'lib/ngrokapi/client.rb', line 37

def reserved_domains
  @_reserved_domains ||= NgrokAPI::Services::ReservedDomainsClient.new(client: @client)
end

#tls_certificatesNgrokAPI::Services::TlsCertificatesClient

Creates and returns an instance of a NgrokAPI::Services::TlsCertificatesClient



45
46
47
# File 'lib/ngrokapi/client.rb', line 45

def tls_certificates
  @_tls_certificates ||= NgrokAPI::Services::TlsCertificatesClient.new(client: @client)
end