Class: Medlink::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/medlink/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key) ⇒ Client

Returns a new instance of Client.



4
5
6
# File 'lib/medlink/client.rb', line 4

def initialize(api_key)
  @api_key = api_key
end

Instance Attribute Details

#api_keyObject (readonly)

Returns the value of attribute api_key.



8
9
10
# File 'lib/medlink/client.rb', line 8

def api_key
  @api_key
end

Instance Method Details

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



10
11
12
13
# File 'lib/medlink/client.rb', line 10

def get(url, params = {})
  params[:api_key] = api_key
  client.get(api_url(url), params)
end