Class: GetResponseApi::Connection
- Inherits:
-
Object
- Object
- GetResponseApi::Connection
- Defined in:
- lib/get_response_api/connection.rb
Constant Summary collapse
- API_ENDPOINT =
'https://api.getresponse.com/v3'.freeze
- TIMEOUT =
7
Instance Method Summary collapse
-
#initialize(api_key) ⇒ Connection
constructor
A new instance of Connection.
- #request(method, path) ⇒ Object
Constructor Details
#initialize(api_key) ⇒ Connection
Returns a new instance of Connection.
8 9 10 |
# File 'lib/get_response_api/connection.rb', line 8 def initialize(api_key) @api_key = api_key end |
Instance Method Details
#request(method, path) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/get_response_api/connection.rb', line 12 def request(method, path) response = http_request(method, path).parsed_response if error?(response) && response['message'] return response['message'] end response end |