Class: Holivia::Client
- Inherits:
-
Object
- Object
- Holivia::Client
- Defined in:
- lib/holivia/client.rb
Instance Method Summary collapse
- #delete(path, headers: {}) ⇒ Object
- #get(path, params: {}, headers: {}) ⇒ Object
-
#initialize(base_url: Holivia.configuration.base_url, http: Faraday, auth: Auth.new) ⇒ Client
constructor
A new instance of Client.
- #patch(path, body: {}, headers: {}) ⇒ Object
- #post(path, body: {}, headers: {}) ⇒ Object
Constructor Details
#initialize(base_url: Holivia.configuration.base_url, http: Faraday, auth: Auth.new) ⇒ Client
Returns a new instance of Client.
8 9 10 11 12 |
# File 'lib/holivia/client.rb', line 8 def initialize(base_url: Holivia.configuration.base_url, http: Faraday, auth: Auth.new) @base_url = base_url @http = http @auth = auth end |
Instance Method Details
#delete(path, headers: {}) ⇒ Object
26 27 28 |
# File 'lib/holivia/client.rb', line 26 def delete(path, headers: {}) request(:delete, path, headers:) end |
#get(path, params: {}, headers: {}) ⇒ Object
18 19 20 |
# File 'lib/holivia/client.rb', line 18 def get(path, params: {}, headers: {}) request(:get, path, params:, headers:) end |
#patch(path, body: {}, headers: {}) ⇒ Object
22 23 24 |
# File 'lib/holivia/client.rb', line 22 def patch(path, body: {}, headers: {}) request(:patch, path, body:, headers:) end |
#post(path, body: {}, headers: {}) ⇒ Object
14 15 16 |
# File 'lib/holivia/client.rb', line 14 def post(path, body: {}, headers: {}) request(:post, path, body:, headers:) end |