Class: Tomba::Count

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

Overview

Count service for email counting.

Provides methods to get the number of email addresses found for 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_count(domain:) ⇒ Hash

Email Count

Returns the total number of email addresses found for a domain.

Parameters:

  • domain (String)

    the domain name to count emails for

Returns:

  • (Hash)

    API response containing the email count

Raises:

See Also:



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

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

  path = '/email-count'

  params = {}
  params[:domain] = domain unless domain.nil?

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