Class: Tomba::Format

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

Overview

Format service for discovering email formats.

Provides methods to find the email format used by a domain.

Instance Method Summary collapse

Methods inherited from Service

#initialize

Constructor Details

This class inherits a constructor from Tomba::Service

Instance Method Details

#email_format(domain) ⇒ Hash

Email Format

Returns the email format used by a given domain (e.g., first.last, first_last).

Parameters:

  • domain (String)

    the domain name to look up the email format for

Returns:

  • (Hash)

    API response containing the email format

Raises:

See Also:



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

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

  path = '/email-format'

  params = { domain: domain }

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