Module: Cdss::ReferenceTables

Includes:
Utils
Included in:
Client
Defined in:
lib/cdss/reference_tables.rb

Overview

Provides access to reference tables from the CDSS API. These tables provide metadata and lookup information for various CDSS resources.

Constant Summary collapse

VALID_TABLES =

List of valid reference table names that can be queried

%w[
  county
  waterdistricts
  waterdivisions
  designatedbasins
  managementdistricts
  telemetryparams
  climateparams
  divrectypes
  flags
].freeze

Instance Method Summary collapse

Methods included from Utils

#batch_dates, #build_query, #fetch_paginated_data, #format_date, #format_query_param, #parse_timestamp, #safe_float, #safe_integer

Instance Method Details

#get_reference_table(table_name, **params) ⇒ Array<Cdss::Models::ReferenceTable>

Fetches reference table data from the CDSS API.

Parameters:

  • table_name (String)

    The name of the reference table to fetch. Must be one of: county, waterdistricts, waterdivisions, designatedbasins, managementdistricts, telemetryparams, climateparams, divrectypes, flags

  • params (Hash)

    Additional parameters for filtering table data

Returns:

Raises:

  • (ArgumentError)

    If an invalid table name is provided



30
31
32
33
34
# File 'lib/cdss/reference_tables.rb', line 30

def get_reference_table(table_name, **params)
  validate_table_name!(table_name)
  method_name = "fetch_#{table_name}_reference"
  send(method_name, **params)
end