Class: Relcy::Client

Inherits:
Base
  • Object
show all
Includes:
API
Defined in:
lib/relcy/client.rb

Constant Summary

Constants included from API

API::BASE_URL

Instance Method Summary collapse

Methods included from API::Lookup

#lookup

Methods included from API::Detail

#detail

Methods included from API::Search

#search

Methods included from API::Autocomplete

#autocomplete

Constructor Details

#initialize(api_key) ⇒ Client

Returns a new instance of Client.



11
12
13
14
15
16
17
18
# File 'lib/relcy/client.rb', line 11

def initialize(api_key)
  @connection = Faraday.new(:url => BASE_URL) do |conn|
    conn.request  :url_encoded
    conn.response :json, :content_type => /\bjson$/
    conn.adapter :typhoeus
    conn.params["api_key"] = api_key
  end
end