Class: BankOfThailand::InterbankRate

Inherits:
Resource
  • Object
show all
Defined in:
lib/bank_of_thailand/resources/interbank_rate.rb

Overview

Interbank Transaction Rates resource

This resource provides access to interbank transaction rates from commercial banks and financial institutions in Thailand.

Examples:

Get interbank rates

client = BankOfThailand.client
rates = client.interbank_rate.rates(
  start_period: "2024-01-01",
  end_period: "2024-01-31",
  term_type: "O/N"
)

Constant Summary collapse

BASE_URL =
"https://gateway.api.bot.or.th/Stat-InterbankTransactionRate/v2/INTRBNK_TXN_RATE"

Instance Attribute Summary

Attributes inherited from Resource

#client

Instance Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from BankOfThailand::Resource

Instance Method Details

#rates(start_period:, end_period:, term_type: nil) ⇒ Hash

Get interbank transaction rates

Parameters:

  • start_period (String)

    Start period date (YYYY-MM-DD)

  • end_period (String)

    End period date (YYYY-MM-DD)

  • term_type (String, nil) (defaults to: nil)

    Term type (e.g., "O/N", "T/N") (optional)

Returns:

  • (Hash)

    Response containing interbank transaction rate data

Raises:



26
27
28
29
30
31
# File 'lib/bank_of_thailand/resources/interbank_rate.rb', line 26

def rates(start_period:, end_period:, term_type: nil)
  params = { start_period: start_period, end_period: end_period }
  params[:term_type] = term_type if term_type

  get_with_base_url("/", params)
end