def connection
      @connection ||= begin
        params = {
          :client_id     => client_id,
          :client_secret => client_secret
        }

        Faraday::Connection.new(:url => api_url, :ssl => ssl, :params => params, :headers => default_headers) do |builder|
          builder.use Faraday::Request::Multipart
          builder.use Faraday::Request::UrlEncoded

          builder.use FaradayMiddleware::Mashify
          builder.use FaradayMiddleware::ParseJson

          builder.adapter Faraday.default_adapter
        end
      end
    end
def connection
      @connection ||= begin
        params = {
          :client_id     => client_id,
          :client_secret => client_secret
        }

        Faraday::Connection.new(:url => api_url, :ssl => ssl, :params => params, :headers => default_headers) do |builder|
          builder.use Faraday::Request::Multipart
          builder.use Faraday::Request::UrlEncoded

          builder.use FaradayMiddleware::Mashify
          builder.use FaradayMiddleware::ParseJson

          builder.adapter Faraday.default_adapter
        end
      end
    end
Initialize the client class that will be used for all checkd.in API requests.  Requires a valid client_id and client_secret - more info at http://developer.checkd.in


 @param [Hash] options
 @option options String :client_id Your foursquare app's client_id
 @option options String :client_secret Your foursquare app's client_secret
 @option options String :api_url A custom API url, does not usually have to be overridden
 @option options Hash   :ssl Additional SSL options (like the path to certificate file)
 Sets up the connection to be used for all requests based on options passed during initialization.