Class: Resource
- Inherits:
-
Object
- Object
- Resource
- Defined in:
- lib/loadlab/client.rb
Constant Summary collapse
- BASE_URL =
'https://api.loadlab.co/v1'
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(api_token, path) ⇒ Resource
constructor
A new instance of Resource.
Constructor Details
#initialize(api_token, path) ⇒ Resource
Returns a new instance of Resource.
6 7 8 9 10 11 12 |
# File 'lib/loadlab/client.rb', line 6 def initialize(api_token, path) @path = path @headers = { Authorization: "Token #{api_token}", Accept: 'application/json', } end |
Instance Method Details
#get ⇒ Object
14 15 16 |
# File 'lib/loadlab/client.rb', line 14 def get HTTParty.get(BASE_URL + @path, headers: @headers) end |