Class: Qualityforward::Client
- Inherits:
-
Object
- Object
- Qualityforward::Client
show all
- Includes:
- Qualityforward
- Defined in:
- lib/qualityforward/client.rb
Constant Summary
VERSION
Instance Method Summary
collapse
#method_missing
Constructor Details
#initialize(api_key = nil) ⇒ Client
7
8
9
|
# File 'lib/qualityforward/client.rb', line 7
def initialize(api_key = nil)
@@api_key = api_key unless nil
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Qualityforward
Instance Method Details
#get(path) ⇒ Object
15
16
17
18
|
# File 'lib/qualityforward/client.rb', line 15
def get path
res = Faraday.get url(path)
JSON.parse res.body
end
|
#url(path) ⇒ Object
11
12
13
|
# File 'lib/qualityforward/client.rb', line 11
def url path
return "#{@@url}#{path}?api_key=#{@@api_key}"
end
|