Class: LemonwayOnboarding::Client
- Inherits:
-
Object
- Object
- LemonwayOnboarding::Client
- Defined in:
- lib/lemonway_onboarding/client.rb
Overview
Client for interacting with the Ohme API
Instance Method Summary collapse
-
#delete(endpoint, params = {}) ⇒ Hash?
Performs a DELETE request.
-
#get(endpoint, params = {}) ⇒ Hash?
Performs a GET request.
-
#initialize(configuration = LemonwayOnboarding::Configuration.new) ⇒ Client
constructor
Initializes the client with the configuration.
-
#post(endpoint, body = {}) ⇒ Hash
Performs a POST request.
-
#put(endpoint, body = {}) ⇒ Hash
Performs a PUT request.
Constructor Details
#initialize(configuration = LemonwayOnboarding::Configuration.new) ⇒ Client
Initializes the client with the configuration
12 13 14 15 |
# File 'lib/lemonway_onboarding/client.rb', line 12 def initialize(configuration = LemonwayOnboarding::Configuration.new) @configuration = configuration @configuration.validate! end |
Instance Method Details
#delete(endpoint, params = {}) ⇒ Hash?
Performs a DELETE request
50 51 52 |
# File 'lib/lemonway_onboarding/client.rb', line 50 def delete(endpoint, params = {}) request(:delete, endpoint, params: params) end |
#get(endpoint, params = {}) ⇒ Hash?
Performs a GET request
22 23 24 |
# File 'lib/lemonway_onboarding/client.rb', line 22 def get(endpoint, params = {}) request(:get, endpoint, params: params) end |
#post(endpoint, body = {}) ⇒ Hash
Performs a POST request
31 32 33 |
# File 'lib/lemonway_onboarding/client.rb', line 31 def post(endpoint, body = {}) request(:post, endpoint, body: body) end |
#put(endpoint, body = {}) ⇒ Hash
Performs a PUT request
40 41 42 |
# File 'lib/lemonway_onboarding/client.rb', line 40 def put(endpoint, body = {}) request(:put, endpoint, body: body) end |