Module: Fleetly::Request
- Included in:
- Client
- Defined in:
- lib/fleetly/request.rb
Instance Method Summary collapse
Instance Method Details
#get(path, options) ⇒ Object
7 8 9 |
# File 'lib/fleetly/request.rb', line 7 def get(path, ) request(:get, path, ) end |
#post(path, options) ⇒ Object
11 12 13 |
# File 'lib/fleetly/request.rb', line 11 def post(path, ) request(:post, path, ) end |
#request(method, path, options) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/fleetly/request.rb', line 15 def request(method, path, ) response = connection.send(method) do |request| case method when :get request.url(path, ) when :put, :post request.path = path request.body = MultiJson.encode() unless .empty? end end response.body end |