Class: BankOfThailand::ImpliedRate

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

Overview

Thai Baht Implied Interest Rates resource

This resource provides access to Thai Baht implied interest rates derived from the swap market.

Examples:

Get implied interest rates

client = BankOfThailand.client
rates = client.implied_rate.rates(
  start_period: "2024-01-01",
  end_period: "2024-01-31",
  rate_type: "ONSHORE : T/N"
)

Constant Summary collapse

BASE_URL =
"https://gateway.api.bot.or.th/Stat-ThaiBahtImpliedInterestRate/v2/THB_IMPL_INT_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:, rate_type: nil) ⇒ Hash

Get Thai Baht implied interest rates

Parameters:

  • start_period (String)

    Start period date (YYYY-MM-DD)

  • end_period (String)

    End period date (YYYY-MM-DD)

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

    Rate type (e.g., "ONSHORE : T/N") (optional)

Returns:

  • (Hash)

    Response containing Thai Baht implied interest rate data

Raises:



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

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

  get_with_base_url("/", params)
end