Class: RenderAPI::Endpoint
- Inherits:
-
Object
- Object
- RenderAPI::Endpoint
- Defined in:
- lib/render_api/endpoint.rb
Constant Summary collapse
- HOST =
"https://api.render.com"
- VERSION =
"/v1"
Instance Method Summary collapse
- #delete(path) ⇒ Object
- #get(path, params: nil) ⇒ Object
-
#initialize(api_key) ⇒ Endpoint
constructor
A new instance of Endpoint.
- #patch(path, body: nil) ⇒ Object
- #post(path, body: nil) ⇒ Object
- #put(path, body: nil) ⇒ Object
Constructor Details
#initialize(api_key) ⇒ Endpoint
Returns a new instance of Endpoint.
13 14 15 |
# File 'lib/render_api/endpoint.rb', line 13 def initialize(api_key) @api_key = api_key end |
Instance Method Details
#delete(path) ⇒ Object
33 34 35 |
# File 'lib/render_api/endpoint.rb', line 33 def delete(path) request(:delete, path) end |
#get(path, params: nil) ⇒ Object
17 18 19 |
# File 'lib/render_api/endpoint.rb', line 17 def get(path, params: nil) request(:get, path, params: params) end |
#patch(path, body: nil) ⇒ Object
21 22 23 |
# File 'lib/render_api/endpoint.rb', line 21 def patch(path, body: nil) request(:patch, path, body: camelise(body)) end |
#post(path, body: nil) ⇒ Object
25 26 27 |
# File 'lib/render_api/endpoint.rb', line 25 def post(path, body: nil) request(:post, path, body: camelise(body)) end |
#put(path, body: nil) ⇒ Object
29 30 31 |
# File 'lib/render_api/endpoint.rb', line 29 def put(path, body: nil) request(:put, path, body: camelise(body)) end |