Class: CanLII::Client

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

Instance Method Summary collapse

Instance Method Details

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



5
6
7
8
9
10
11
12
13
# File 'lib/canlii/client.rb', line 5

def get(path, params = {})
  params = params.merge(api_key: config.api_key, language: config.language)

  http_client = HTTP
  http_client = http_client.timeout(config.timeout) if config.timeout

  response = http_client.get(build_url(path), params: params)
  handle_response(response)
end