Class: AbsorbApi::Api
- Inherits:
-
Object
- Object
- AbsorbApi::Api
- Defined in:
- lib/absorb_api/api.rb
Instance Attribute Summary collapse
Instance Method Summary collapse
- #delete(path, params = {}) ⇒ Object
- #get(path, params = {}) ⇒ Object
- #patch(path, params = {}) ⇒ Object
- #post(path, params = {}) ⇒ Object
- #put(path, params = {}) ⇒ Object
Instance Attribute Details
#connection ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/absorb_api/api.rb', line 9 def connection Faraday.new( url: AbsorbApi.configuration.url, parallel_manager: Typhoeus::Hydra.new(max_concurrency: 200) ) do |faraday| faraday.request :json faraday.response :json, content_type: /\bjson$/ faraday.adapter :typhoeus faraday.headers = { "Authorization" => AbsorbApi.token } end end |
Instance Method Details
#delete(path, params = {}) ⇒ Object
37 38 39 |
# File 'lib/absorb_api/api.rb', line 37 def delete(path, params = {}) request(:delete, path, params) end |
#get(path, params = {}) ⇒ Object
21 22 23 |
# File 'lib/absorb_api/api.rb', line 21 def get(path, params = {}) request(:get, path, params) end |
#patch(path, params = {}) ⇒ Object
29 30 31 |
# File 'lib/absorb_api/api.rb', line 29 def patch(path, params = {}) request(:patch, path, params) end |
#post(path, params = {}) ⇒ Object
33 34 35 |
# File 'lib/absorb_api/api.rb', line 33 def post(path, params = {}) request(:post, path, params) end |
#put(path, params = {}) ⇒ Object
25 26 27 |
# File 'lib/absorb_api/api.rb', line 25 def put(path, params = {}) request(:put, path, params) end |