Module: Genability::Client::Season

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

Overview

Most LSEs will charge different rates depending on the time of year. Each LSE defines the times of the year themselves but typically they are split into Summer and Winter. We refer to these as the Seasons of an LSE. We also define Season Groups, which contain more than Seasons and which altogether span a full calendar year. Each Season belongs to one and only one Season Group.

Instance Method Summary collapse

Instance Method Details

#seasons(load_serving_entity_id, options = {}) ⇒ Array

Returns a list of season groups for a given load serving entity.

Examples:

Return a list of season groups for Pacific Gas & Electric Co

Genability.seasons(734)

Parameters:

  • load_serving_entity_id (Integer)

    Unique Genability ID (primary key) for a Load Serving Entity.

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

    A customizable set of options.

Options Hash (options):

  • :search (String)

    The string of text to search on. This can also be a regular expression, in which case you should set the 'isRegex' flag to true. (Optional)

  • :search_on (String)

    Comma separated list of fields to query on. When searchOn is specified, the text provided in the search string field will be searched within these fields. The list of fields to search on depend on the entity being searched for. Read the documentation for the entity for more details on the fields that can be searched, and the default fields to be searched if searchOn is not specified. (Optional)

  • :starts_with (Boolean)

    When true, the search will only return results that begin with the specified search string. Otherwise, any match of the search string will be returned as a result. Default is false. (Optional)

  • :ends_with (Boolean)

    When true, the search will only return results that end with the specified search string. Otherwise, any match of the search string will be returned as a result. Default is false. (Optional)

  • :is_regex (Boolean)

    When true, the provided search string will be regarded as a regular expression and the search will return results matching the regular expression. Default is false. (Optional)

  • :sort_on (String)

    Comma separated list of fields to sort on. This can also be input via Array Inputs (see above). (Optional)

  • :sort_order (String)

    Comma separated list of ordering. Possible values are 'ASC' and 'DESC'. Default is 'ASC'. If your sortOn contains multiple fields and you would like to order fields individually, you can pass in a comma separated list here (or use Array Inputs, see above). For example, if your sortOn contained 5 fields, and your sortOrder contained 'ASC, DESC, DESC', these would be applied to the first three items in the sortOn field. The remaining two would default to ASC. (Optional)

Returns:

  • (Array)

    list of season groups for a load serving entity.

See Also:

Supported formats:

  • :json

Requires Authentication:

  • true

Rate Limited:

  • true



49
50
51
# File 'lib/genability/client/season.rb', line 49

def seasons(load_serving_entity_id, options = {})
  get("public/seasons", season_params(load_serving_entity_id, options)).results
end