Class: Tomba::Enrichment

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

Overview

Enrichment service for data enrichment.

Provides methods to enrich person and company data.

Instance Method Summary collapse

Methods inherited from Service

#initialize

Constructor Details

This class inherits a constructor from Tomba::Service

Instance Method Details

#combined(email) ⇒ Hash

Combined Enrichment

Returns combined person and company enrichment data for an email.

Parameters:

  • email (String)

    the email address to enrich

Returns:

  • (Hash)

    API response containing combined enrichment data

Raises:

See Also:



60
61
62
63
64
65
66
67
68
69
70
# File 'lib/tomba/services/enrichment.rb', line 60

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

  path = '/enrichment/combined'

  params = { email: email }

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

#company(domain) ⇒ Hash

Company Enrichment

Enriches data about a company using its domain name.

Parameters:

  • domain (String)

    the domain name of the company

Returns:

  • (Hash)

    API response containing enriched company data

Raises:

See Also:



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/tomba/services/enrichment.rb', line 40

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

  path = '/enrichment/company'

  params = { domain: domain }

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

#person(email, webhook_url: nil) ⇒ Hash

Person Enrichment

Enriches data about a person using their email address.

Parameters:

  • email (String)

    the email address of the person

  • webhook_url (String, nil) (defaults to: nil)

    webhook URL for async notifications

Returns:

  • (Hash)

    API response containing enriched person data

Raises:

See Also:



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

def person(email, webhook_url: nil)
  raise Tomba::Exception, 'Missing required parameter: "email"' if email.nil?

  path = '/enrichment/person'

  params = { email: email }
  params[:webhook_url] = webhook_url unless webhook_url.nil?

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