Class: BriteAPI::APIClient
- Inherits:
-
Object
- Object
- BriteAPI::APIClient
- Defined in:
- lib/brite-api/api_client.rb
Direct Known Subclasses
AddressAPIClient, EmailAPIClient, IpAPIClient, NameAPIClient, PhoneAPIClient
Constant Summary collapse
- API_HOST =
'https://bpi.briteverify.com'
Instance Method Summary collapse
- #get(url, params = {}) ⇒ Object
-
#initialize(api_key, options = {}) ⇒ APIClient
constructor
A new instance of APIClient.
- #verify(value) ⇒ Object
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, = {}) @api_key = api_key @options = @rest = Rest::Client.new(:gem => [: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 = {}) = { :params => params.merge(:apikey => @api_key) } JSON.parse @rest.get(url, ).body end |
#verify(value) ⇒ Object
14 15 16 |
# File 'lib/brite-api/api_client.rb', line 14 def verify(value) raise "Not implemented" end |