Module: Genability::Client::Tariff

Included in:
Genability::Client
Defined in:
lib/genability/client/tariff.rb

Overview

Tariffs are rate plans for electricity. They describe who the plan applies to (service and applicability), what the charges are, and other information about this electricity service:

  1. We have residential tariffs currently. General tariffs (commercial & industrial and speciality tariffs) are coming soon.
  2. You can specify whether you want the tariff fully populated, or whether you just want a sub section of the data (to avoid charges and to speed up your queries).

Instance Method Summary collapse

Instance Method Details

#tariff(tariff_id, options = {}) ⇒ Hashie::Mash

Returns one tariff.

Examples:

Return the residential serice tariff for Georgia Power Co

Genability.tariff(512)

Parameters:

  • tariff_id (Integer)

    Unique Genability ID (primary key) for a tariff.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :populate_rates (Boolean)

    Populates the rate details for the returned Tariff. (Optional)

Returns:

  • (Hashie::Mash)

    A tariff.

See Also:

Supported formats:

  • :json

Requires Authentication:

  • true

Rate Limited:

  • true



53
54
55
# File 'lib/genability/client/tariff.rb', line 53

def tariff(tariff_id, options = {})
  get("public/tariffs/#{tariff_id}", tariff_params(options)).results.first
end

#tariffs(options = {}) ⇒ Array

Returns a list of tariffs.

Examples:

Return the first 25 tariffs

Genability.tariffs

Return the tariffs for Georgia Power Co

Genability.tariffs(:lse_id => 2756)

Return only residential tariffs

Genability.tariffs(:customer_classes => 'residential')

Return only default and alternative tariff types

Genability.tariffs(:tariff_types => ['default', 'alternative'])

Parameters:

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :lse_id (Integer)

    Filter tariffs for a specific Load Serving Entity. (Optional)

  • :effective_on (Date)

    Only tariffs that are effective on this date. (Optional)

  • :customer_classes (String, Array)

    Only include these customer classes. Choices are: RESIDENTIAL, GENERAL. (Optional)

  • :tariff_types (String, Array)

    Only include these tariff types. Choices are: DEFAULT, ALTERNATIVE, OPTIONAL_EXTRA, RIDER. (Optional)

  • :zip_code (String)

    Return tariffs for this zip or post code. (Optional)

  • :populate_rates (Boolean)

    Populates the rate details for the returned Tariffs. (Optional)

  • :page (Integer)

    The page number to begin the result set from. If not specified, this will begin with the first result set. (Optional)

  • :per_page (Integer)

    The number of results to return. If not specified, this will return 25 results. (Optional)

Returns:

  • (Array)

    List of tariffs.

See Also:

Supported formats:

  • :json

Requires Authentication:

  • true

Rate Limited:

  • true



37
38
39
# File 'lib/genability/client/tariff.rb', line 37

def tariffs(options = {})
  get("public/tariffs", tariffs_params(options)).results
end