Class: Qualityforward::Client
- Inherits:
-
Object
- Object
- Qualityforward::Client
- Includes:
- Qualityforward
- Defined in:
- lib/qualityforward/client.rb
Constant Summary
Constants included from Qualityforward
Instance Method Summary collapse
- #get(path) ⇒ Object
-
#initialize(api_key = nil) ⇒ Client
constructor
A new instance of Client.
- #url(path) ⇒ Object
Methods included from Qualityforward
Constructor Details
#initialize(api_key = nil) ⇒ Client
Returns a new instance of 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 |