Class: Bento::Client
- Inherits:
-
Object
- Object
- Bento::Client
- Defined in:
- lib/bento/core/client.rb
Overview
Client class for interacting with the Bento API. This class provides methods for making HTTP GET and POST requests to the API, handles authentication, connection errors, and response parsing. It also supports a development mode for local testing.
Instance Method Summary collapse
Instance Method Details
#get(endpoint) ⇒ Object
7 8 9 |
# File 'lib/bento/core/client.rb', line 7 def get(endpoint) handle_connection_errors { parse_response(conn.get(endpoint)) } end |
#post(endpoint, payload = nil) ⇒ Object
11 12 13 |
# File 'lib/bento/core/client.rb', line 11 def post(endpoint, payload = nil) handle_connection_errors { parse_response(conn.post(endpoint, payload)) } end |