Class: Darwinex::Api::Api

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/darwinex/api/api.rb

Direct Known Subclasses

InfoApi, InvestorAccountInfoApi, TokenApi, TradingApi

Instance Method Summary collapse

Constructor Details

#initialize(logger) ⇒ Api

Returns a new instance of Api.



12
13
14
# File 'lib/darwinex/api/api.rb', line 12

def initialize(logger)
  @logger = logger
end

Instance Method Details

#send(http_method, path, options, max_retries:) ⇒ Object



16
17
18
19
20
# File 'lib/darwinex/api/api.rb', line 16

def send(http_method, path, options, max_retries:)
  response = backoff_and_retry(http_method, path, options, max_retries: max_retries)

  response.parsed_response
end