Class: BriteAPI::APIClient

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

Constant Summary collapse

API_HOST =
'https://bpi.briteverify.com'

Instance Method Summary collapse

Constructor Details

#initialize(api_key, options = {}) ⇒ APIClient

Returns a new instance of APIClient.



8
9
10
11
12
# File 'lib/brite-api/api_client.rb', line 8

def initialize(api_key, options = {})
  @api_key = api_key
  @options = options
  @rest = Rest::Client.new(:gem => options[:gem])
end

Instance Method Details

#get(url, params = {}) ⇒ Object



18
19
20
21
22
23
24
25
# File 'lib/brite-api/api_client.rb', line 18

def get(url, params = {})

  options = {
    :params => params.merge(:apikey => @api_key)
  }

  JSON.parse @rest.get(url, options).body
end

#verify(value) ⇒ Object



14
15
16
# File 'lib/brite-api/api_client.rb', line 14

def verify(value)
  raise "Not implemented"
end