Module: Dnsimple::Client::Services

Included in:
ServicesService
Defined in:
lib/dnsimple/client/services.rb

Instance Method Summary collapse

Instance Method Details

#service(service, options = {}) ⇒ Struct::Service

Gets a service.

Parameters:

  • service (Fixnum)

    The service id.

Returns:

Raises:

See Also:



29
30
31
32
33
# File 'lib/dnsimple/client/services.rb', line 29

def service(service, options = {})
  response = client.get(Client.versioned("services/#{service}"), options)

  Struct::Service.new(response["service"])
end

#services(options = {}) ⇒ Array<Struct::Service> Also known as: list, list_services

Lists the supported services.

Returns:

Raises:

See Also:



12
13
14
15
16
# File 'lib/dnsimple/client/services.rb', line 12

def services(options = {})
  response = client.get(Client.versioned("services"), options)

  response.map { |r| Struct::Service.new(r["service"]) }
end