Class: Wes::Data::API::Request
- Inherits:
-
Object
- Object
- Wes::Data::API::Request
- Defined in:
- lib/wes/data/api/request.rb
Class Method Summary collapse
- .delete(path) ⇒ Object
- .get(path) ⇒ Object
- .post(path, options) ⇒ Object
- .put(path, options) ⇒ Object
Class Method Details
.delete(path) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/wes/data/api/request.rb', line 35 def delete(path) connection.delete do |r| r..timeout = TIMEOUT r.url complete_path(path) end end |
.get(path) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/wes/data/api/request.rb', line 10 def get(path) connection.get do |r| r..timeout = TIMEOUT r.url complete_path(path) end end |
.post(path, options) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/wes/data/api/request.rb', line 17 def post(path, ) connection.post do |r| r.body = .to_json r.headers["Content-Type"] = "application/json" r..timeout = TIMEOUT r.url complete_path(path) end end |
.put(path, options) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/wes/data/api/request.rb', line 26 def put(path, ) connection.put do |r| r.body = .to_json r.headers["Content-Type"] = "application/json" r..timeout = TIMEOUT r.url complete_path(path) end end |