Sha256: 7bc95a48cac66788d80740f79862c97a878d0276be220ed617051453e2b3c436
Contents?: true
Size: 626 Bytes
Versions: 1
Compression:
Stored size: 626 Bytes
Contents
module Medlink class Client def initialize(api_key) @api_key = api_key end attr_reader :api_key def get(url, params = {}) params[:api_key] = api_key client.get(api_url(url), params) end private def client @client ||= Faraday.new(url: site) do |faraday| faraday.request :url_encoded # form-encode POST params faraday.adapter Faraday.default_adapter # make requests with Net::HTTP end end def site Medlink.configuration.site end def api_url(url) "/api/#{url}" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
medlink-0.1.0 | lib/medlink/client.rb |