Module: ZephyrRuby::Connection
- Included in:
- Client
- Defined in:
- lib/zephyr_ruby/connection.rb
Overview
Connection provides the base functionality for interacting with APIs using get, post, put, and delete operations.
Instance Method Summary collapse
- #delete(path, params = {}) ⇒ Object
- #get(path, params = {}) ⇒ Object
- #post(path, body) ⇒ Object
- #put(path, body) ⇒ Object
Instance Method Details
#delete(path, params = {}) ⇒ Object
21 22 23 |
# File 'lib/zephyr_ruby/connection.rb', line 21 def delete(path, params = {}) request :delete, path, params end |
#get(path, params = {}) ⇒ Object
7 8 9 |
# File 'lib/zephyr_ruby/connection.rb', line 7 def get(path, params = {}) request :get, path, params end |
#post(path, body) ⇒ Object
11 12 13 14 |
# File 'lib/zephyr_ruby/connection.rb', line 11 def post(path, body) body = body.to_json if body.is_a?(Hash) request :post, path, body end |
#put(path, body) ⇒ Object
16 17 18 19 |
# File 'lib/zephyr_ruby/connection.rb', line 16 def put(path, body) body = body.to_json if body.is_a?(Hash) request :put, path, body end |