Module: Hopo::Connections::Request
- Included in:
- API
- Defined in:
- lib/hopo/connections/request.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#delete(parameters = {}, type = 'json') ⇒ Object
Perform a DELETE request to a path.
-
#get(parameters = {}, type = 'json') ⇒ Object
Perform a GET request to a path.
-
#patch(parameters = {}, type = 'json') ⇒ Object
Perform a PATCH request to a path.
-
#post(parameters = {}, type = 'json') ⇒ Object
Perform a POST request to a path.
-
#put(parameters = {}, type = 'json') ⇒ Object
Perform a PUT request to a path.
Class Method Details
.included(base) ⇒ Object
7 8 9 |
# File 'lib/hopo/connections/request.rb', line 7 def self.included(base) base.extend(ClassMethods) end |
Instance Method Details
#delete(parameters = {}, type = 'json') ⇒ Object
Perform a DELETE request to a path
32 33 34 |
# File 'lib/hopo/connections/request.rb', line 32 def delete(parameters={}, type='json') perform_request Net::HTTP::Delete, parameters, type end |
#get(parameters = {}, type = 'json') ⇒ Object
Perform a GET request to a path
12 13 14 |
# File 'lib/hopo/connections/request.rb', line 12 def get(parameters={}, type='json') perform_request Net::HTTP::Get, parameters, type end |
#patch(parameters = {}, type = 'json') ⇒ Object
Perform a PATCH request to a path
22 23 24 |
# File 'lib/hopo/connections/request.rb', line 22 def patch(parameters={}, type='json') perform_request Net::HTTP::Patch, parameters, type end |
#post(parameters = {}, type = 'json') ⇒ Object
Perform a POST request to a path
17 18 19 |
# File 'lib/hopo/connections/request.rb', line 17 def post(parameters={}, type='json') perform_request Net::HTTP::Post, parameters, type end |
#put(parameters = {}, type = 'json') ⇒ Object
Perform a PUT request to a path
27 28 29 |
# File 'lib/hopo/connections/request.rb', line 27 def put(parameters={}, type='json') perform_request Net::HTTP::Put, parameters, type end |