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