Class: Enrich::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/enrich-api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



22
23
24
25
26
27
# File 'lib/enrich-api.rb', line 22

def initialize()
  @auth = {}

  @enrich = Enrich::EnrichResource.new(self)
  @verify = Enrich::VerifyResource.new(self)
end

Instance Attribute Details

#enrichObject

Returns the value of attribute enrich.



19
20
21
# File 'lib/enrich-api.rb', line 19

def enrich
  @enrich
end

#rest_base_pathObject



40
41
42
# File 'lib/enrich-api.rb', line 40

def rest_base_path
  @rest_base_path || "/v1"
end

#rest_hostObject



36
37
38
# File 'lib/enrich-api.rb', line 36

def rest_host
  @rest_host || "https://api.enrich.email"
end

#verifyObject

Returns the value of attribute verify.



20
21
22
# File 'lib/enrich-api.rb', line 20

def verify
  @verify
end

Instance Method Details

#_get(resource, query) ⇒ Object



48
49
50
# File 'lib/enrich-api.rb', line 48

def _get(resource, query)
  self._do_get(resource, query)
end

#authenticate(user_id, secret_key) ⇒ Object



31
32
33
34
# File 'lib/enrich-api.rb', line 31

def authenticate(user_id, secret_key)
  @auth["user_id"] = user_id
  @auth["secret_key"] = secret_key
end

#timeoutObject



44
45
46
# File 'lib/enrich-api.rb', line 44

def timeout
  @timeout || 40
end