Module: Genability::Client::Property

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

Overview

Properties are metadata associated with a tariff. They are frequently used to determine applicability for a particular set of rates within a tariff. For example, the property cityLimits is used when a tariff has different rates based on whether the consumer lives inside or outside the city limits.

Instance Method Summary collapse

Instance Method Details

#properties(options = {}) ⇒ Array

This returns a list of Properties based on a search criteria. The result set is an array of Property objects in the standard response format.

Parameters:

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

    A customizable set of options.

Options Hash (options):

  • :entity_id (Integer)

    Filters the result set to only include Properties that belong to this entityId. EntityType must also be specified, otherwise this is ignored (Optional).

  • :entity_type (String)

    Filters the result set to only include Properties that belong to this entityType. EntityId must also be specified, otherwise this is ignored. Currently the only supported value is 'LSE' (Optional)

Returns:

  • (Array)

    Array of property objects.

See Also:

Supported formats:

  • :json

Requires Authentication:

  • true

Rate Limited:

  • true



38
39
40
# File 'lib/genability/client/property.rb', line 38

def properties(options = {})
  get("public/properties", property_params(options)).results
end

#property(key_name) ⇒ Hashie::Mash

This allows you to retrieve one Property using its keyname. This is particularly useful when using the Calculator as it may require you to specify certain applicability values prior to making the calculation.

Parameters:

  • key_name (String)

    Property key name

Returns:

  • (Hashie::Mash)

    Details for a property.

See Also:

Supported formats:

  • :json

Requires Authentication:

  • true

Rate Limited:

  • true



19
20
21
# File 'lib/genability/client/property.rb', line 19

def property(key_name)
  get("public/properties/#{key_name}").results.first
end