Class: Ruberto::Request
- Inherits:
-
Object
- Object
- Ruberto::Request
- Defined in:
- lib/ruberto/request.rb
Constant Summary collapse
- BASE_URL =
"https://api.uber.com/v1"
Instance Method Summary collapse
- #delete(params: {}, headers: {}) ⇒ Object
- #get(params: {}) ⇒ Object
-
#initialize(url) ⇒ Request
constructor
A new instance of Request.
- #patch(body:, headers: {}) ⇒ Object
- #post(body: {}, headers: {}) ⇒ Object
- #put(body:, headers: {}) ⇒ Object
Constructor Details
#initialize(url) ⇒ Request
Returns a new instance of Request.
10 11 12 |
# File 'lib/ruberto/request.rb', line 10 def initialize(url) @url = url end |
Instance Method Details
#delete(params: {}, headers: {}) ⇒ Object
30 31 32 |
# File 'lib/ruberto/request.rb', line 30 def delete(params: {}, headers: {}) handle_response connection.delete(@url, params, headers) end |
#get(params: {}) ⇒ Object
14 15 16 |
# File 'lib/ruberto/request.rb', line 14 def get(params: {}) handle_response connection.get(@url, params) end |
#patch(body:, headers: {}) ⇒ Object
22 23 24 |
# File 'lib/ruberto/request.rb', line 22 def patch(body:, headers: {}) handle_response connection.patch(@url, body, headers) end |
#post(body: {}, headers: {}) ⇒ Object
18 19 20 |
# File 'lib/ruberto/request.rb', line 18 def post(body: {}, headers: {}) handle_response connection.post(@url, body, headers) end |
#put(body:, headers: {}) ⇒ Object
26 27 28 |
# File 'lib/ruberto/request.rb', line 26 def put(body:, headers: {}) handle_response connection.put(@url, body, headers) end |