Class: ValrApi::Client
Instance Method Summary collapse
- #delete(endpoint) ⇒ Object
- #get(endpoint) ⇒ Object
-
#initialize(api_key, api_secret) ⇒ Client
constructor
A new instance of Client.
- #post(endpoint, options = {}) ⇒ Object
Constructor Details
#initialize(api_key, api_secret) ⇒ Client
Returns a new instance of Client.
14 15 16 17 |
# File 'lib/valr_api.rb', line 14 def initialize(api_key, api_secret) @api_key = api_key @api_secret = api_secret end |
Instance Method Details
#delete(endpoint) ⇒ Object
29 30 31 32 |
# File 'lib/valr_api.rb', line 29 def delete(endpoint) sign_request("DELETE", endpoint) self.class.delete(endpoint, headers: headers) end |
#get(endpoint) ⇒ Object
19 20 21 22 |
# File 'lib/valr_api.rb', line 19 def get(endpoint) sign_request("GET", endpoint) self.class.get(endpoint, headers: headers) end |
#post(endpoint, options = {}) ⇒ Object
24 25 26 27 |
# File 'lib/valr_api.rb', line 24 def post(endpoint, = {}) sign_request("POST", endpoint, ) self.class.post(endpoint, { body: , headers: headers }) end |