Class: Enrich::Client
- Inherits:
-
Object
- Object
- Enrich::Client
- Defined in:
- lib/enrich-api.rb
Instance Attribute Summary collapse
-
#enrich ⇒ Object
Returns the value of attribute enrich.
- #rest_base_path ⇒ Object
- #rest_host ⇒ Object
-
#verify ⇒ Object
Returns the value of attribute verify.
Instance Method Summary collapse
- #_get(resource, query) ⇒ Object
- #authenticate(user_id, secret_key) ⇒ Object
-
#initialize ⇒ Client
constructor
A new instance of Client.
- #timeout ⇒ Object
Constructor Details
#initialize ⇒ Client
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
#enrich ⇒ Object
Returns the value of attribute enrich.
19 20 21 |
# File 'lib/enrich-api.rb', line 19 def enrich @enrich end |
#rest_base_path ⇒ Object
40 41 42 |
# File 'lib/enrich-api.rb', line 40 def rest_base_path @rest_base_path || "/v1" end |
#rest_host ⇒ Object
36 37 38 |
# File 'lib/enrich-api.rb', line 36 def rest_host @rest_host || "https://api.enrich.email" end |
#verify ⇒ Object
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 |
#timeout ⇒ Object
44 45 46 |
# File 'lib/enrich-api.rb', line 44 def timeout @timeout || 40 end |