Class: BankOfThailand::Resources::ExchangeRate
- Inherits:
-
BankOfThailand::Resource
- Object
- BankOfThailand::Resource
- BankOfThailand::Resources::ExchangeRate
- Defined in:
- lib/bank_of_thailand/resources/exchange_rate.rb
Overview
Weighted-average Interbank Exchange Rate - THB / USD
This API provides weighted-average interbank exchange rates calculated from daily interbank purchases and sales of US Dollar (against THB) for transactions worth more than or equal to 1 million USD.
Constant Summary collapse
- BASE_URL =
Base URL for this API (overrides the global base URL)
"https://gateway.api.bot.or.th/Stat-ReferenceRate/v2"
Instance Attribute Summary
Attributes inherited from BankOfThailand::Resource
Instance Method Summary collapse
-
#annual(start_period:, end_period:) ⇒ Hash
Get annual weighted-average interbank exchange rate.
-
#daily(start_period:, end_period:) ⇒ Hash
Get daily weighted-average interbank exchange rate.
-
#monthly(start_period:, end_period:) ⇒ Hash
Get monthly weighted-average interbank exchange rate.
-
#quarterly(start_period:, end_period:) ⇒ Hash
Get quarterly weighted-average interbank exchange rate.
Methods inherited from BankOfThailand::Resource
Constructor Details
This class inherits a constructor from BankOfThailand::Resource
Instance Method Details
#annual(start_period:, end_period:) ⇒ Hash
Get annual weighted-average interbank exchange rate
84 85 86 87 88 89 90 |
# File 'lib/bank_of_thailand/resources/exchange_rate.rb', line 84 def annual(start_period:, end_period:) get_with_base_url( "#{BASE_URL}/ANNUAL_REF_RATE/", start_period: start_period, end_period: end_period ) end |
#daily(start_period:, end_period:) ⇒ Hash
Get daily weighted-average interbank exchange rate
27 28 29 30 31 32 33 |
# File 'lib/bank_of_thailand/resources/exchange_rate.rb', line 27 def daily(start_period:, end_period:) get_with_base_url( "#{BASE_URL}/DAILY_REF_RATE/", start_period: start_period, end_period: end_period ) end |
#monthly(start_period:, end_period:) ⇒ Hash
Get monthly weighted-average interbank exchange rate
46 47 48 49 50 51 52 |
# File 'lib/bank_of_thailand/resources/exchange_rate.rb', line 46 def monthly(start_period:, end_period:) get_with_base_url( "#{BASE_URL}/MONTHLY_REF_RATE/", start_period: start_period, end_period: end_period ) end |
#quarterly(start_period:, end_period:) ⇒ Hash
Get quarterly weighted-average interbank exchange rate
65 66 67 68 69 70 71 |
# File 'lib/bank_of_thailand/resources/exchange_rate.rb', line 65 def quarterly(start_period:, end_period:) get_with_base_url( "#{BASE_URL}/QUARTERLY_REF_RATE/", start_period: start_period, end_period: end_period ) end |