Class: Tomba::Location

Inherits:
Service show all
Defined in:
lib/tomba/services/location.rb

Overview

Location service for retrieving company location data.

Provides methods to get the geographic location associated with a domain.

Instance Method Summary collapse

Methods inherited from Service

#initialize

Constructor Details

This class inherits a constructor from Tomba::Service

Instance Method Details

#get_location(domain) ⇒ Hash

Get Location

Returns the geographic location information for a given domain.

Parameters:

  • domain (String)

    the domain name to look up location for

Returns:

  • (Hash)

    API response containing location data

Raises:

See Also:



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/tomba/services/location.rb', line 18

def get_location(domain)
  raise Tomba::Exception, 'Missing required parameter: "domain"' if domain.nil?

  path = '/location'

  params = { domain: domain }

  @client.call('get', path, {
                 'content-type' => 'application/json'
               }, params)
end