Class: BankOfThailand::SwapPoint

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

Overview

Swap Point - Onshore resource

This resource provides access to swap point data for onshore transactions in Thailand.

Examples:

Get swap points

client = BankOfThailand.client
data = client.swap_point.rates(
  start_period: "2024-01-01",
  end_period: "2024-01-31",
  term_type: "1 Month"
)

Constant Summary collapse

BASE_URL =
"https://gateway.api.bot.or.th/Stat-SwapPoint/v2/SWAPPOINT"

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 swap point onshore 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., "1 Month", "3 Month", "6 Month") (optional)

Returns:

  • (Hash)

    Response containing swap point data

Raises:



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

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