Class: Venn::Services::Api
- Inherits:
-
Object
- Object
- Venn::Services::Api
- Defined in:
- lib/venn/services/api.rb
Constant Summary collapse
- KEYS_ENDPOINT =
"http://api.getvenn.io/v1/keys"
- PRIORITY_ENDPOINT =
"http://api.getvenn.io/v1/priority"
Instance Method Summary collapse
- #get_keys ⇒ Object
- #get_priority ⇒ Object
-
#initialize(opts) ⇒ Api
constructor
A new instance of Api.
Constructor Details
#initialize(opts) ⇒ Api
Returns a new instance of Api.
8 9 10 |
# File 'lib/venn/services/api.rb', line 8 def initialize(opts) @api_key = opts[:api_key] end |
Instance Method Details
#get_keys ⇒ Object
12 13 14 15 16 |
# File 'lib/venn/services/api.rb', line 12 def get_keys opts = { :params => { :type => 'email' }, 'venn-api-key' => @api_key } res = RestClient.get Venn::Services::Api::KEYS_ENDPOINT, opts MultiJson.load res, :symbolize_keys => true end |
#get_priority ⇒ Object
18 19 20 21 22 |
# File 'lib/venn/services/api.rb', line 18 def get_priority opts = { :params => { :type => 'email' }, 'venn-api-key' => @api_key } res = RestClient.get Venn::Services::Api::PRIORITY_ENDPOINT, opts MultiJson.load res, :symbolize_keys => true end |