Class: CurrenciesClient
- Inherits:
-
Object
- Object
- CurrenciesClient
- Defined in:
- lib/lockstep_sdk/clients/currencies.rb
Instance Method Summary collapse
-
#bulk_currency_data(destination_currency:, body:) ⇒ Object
Receives an array of dates and currencies and a destination currency and returns an array of the corresponding currency rates to the given destination currency (Limit X).
-
#initialize(lockstepsdk) ⇒ CurrenciesClient
constructor
Initialize the CurrenciesClient class with a lockstepsdk instance.
-
#retrieve_currency_rate(source_currency:, destination_currency:, date:, data_provider:) ⇒ Object
Retrieve a currency conversation rate from one currency to another as of the specified date.
Constructor Details
#initialize(lockstepsdk) ⇒ CurrenciesClient
Initialize the CurrenciesClient class with a lockstepsdk instance.
24 25 26 |
# File 'lib/lockstep_sdk/clients/currencies.rb', line 24 def initialize(lockstepsdk) @lockstepsdk = lockstepsdk end |
Instance Method Details
#bulk_currency_data(destination_currency:, body:) ⇒ Object
Receives an array of dates and currencies and a destination currency and returns an array of the corresponding currency rates to the given destination currency (Limit X).
47 48 49 50 51 |
# File 'lib/lockstep_sdk/clients/currencies.rb', line 47 def bulk_currency_data(destination_currency:, body:) path = "/api/v1/Currencies/bulk" params = {:destinationCurrency => destination_currency} @lockstepsdk.request(:post, path, body, params) end |
#retrieve_currency_rate(source_currency:, destination_currency:, date:, data_provider:) ⇒ Object
Retrieve a currency conversation rate from one currency to another as of the specified date. Optionally, you can specify which currency data provider to use.
The currency rate model contains all of the information used to make the API call, plus the rate to use for the conversion.
37 38 39 40 41 |
# File 'lib/lockstep_sdk/clients/currencies.rb', line 37 def retrieve_currency_rate(source_currency:, destination_currency:, date:, data_provider:) path = "/api/v1/Currencies/#{sourceCurrency}/#{destinationCurrency}" params = {:date => date, :dataProvider => data_provider} @lockstepsdk.request(:get, path, nil, params) end |