Class: AMON::Entity
Overview
An AMON entity, such as a house, business park, or building floor
Instance Attribute Summary
Attributes inherited from Document
Attributes included from JSONHelper
Instance Method Summary collapse
-
#completeness ⇒ Numeric
The all time completeness ratio (0 to 1) for the entity.
-
#completeness_30d ⇒ Numeric
The 30 day completeness ratio (0 to 1) for the entity.
-
#completeness_6m ⇒ Numeric
The 6 month completeness ratio (0 to 1) for the entity.
-
#device_ids ⇒ Array<String>
The ids of all the devices associated with this entity.
-
#devices ⇒ Array<Device>
The devices associated with this entity.
-
#id ⇒ String
The id for this entity.
-
#metering_point_ids ⇒ Array<String>
The qualified ids of all the metering points associated with this entity.
-
#metering_points ⇒ Array<MeteringPoint>
The metering points associated with the entity.
Methods inherited from Document
Constructor Details
This class inherits a constructor from AMON::Document
Instance Method Details
#completeness ⇒ Numeric
Returns The all time completeness ratio (0 to 1) for the entity.
37 38 39 |
# File 'lib/amon/entity.rb', line 37 def completeness @completeness ||= get_completeness end |
#completeness_30d ⇒ Numeric
Returns The 30 day completeness ratio (0 to 1) for the entity.
27 28 29 |
# File 'lib/amon/entity.rb', line 27 def completeness_30d @completeness_30d ||= get_completeness_30d end |
#completeness_6m ⇒ Numeric
Returns The 6 month completeness ratio (0 to 1) for the entity.
32 33 34 |
# File 'lib/amon/entity.rb', line 32 def completeness_6m @completeness_6m ||= get_completeness_6m end |
#device_ids ⇒ Array<String>
Returns The ids of all the devices associated with this entity.
10 |
# File 'lib/amon/entity.rb', line 10 field :device_ids, :name => 'deviceIds', :default => [] |
#devices ⇒ Array<Device>
Returns The devices associated with this entity.
17 18 19 |
# File 'lib/amon/entity.rb', line 17 def devices @devices ||= device_ids.map { |device_id| session.device(id, device_id) } end |
#id ⇒ String
Returns The id for this entity.
7 |
# File 'lib/amon/entity.rb', line 7 field :id, :name => 'entityId' |
#metering_point_ids ⇒ Array<String>
Rename to qualified_metering_point_ids
Returns The qualified ids of all the metering points associated with this entity.
14 |
# File 'lib/amon/entity.rb', line 14 field :metering_point_ids, :name => 'qualifiedMeteringPointIds', :default => [] |
#metering_points ⇒ Array<MeteringPoint>
Returns The metering points associated with the entity.
22 23 24 |
# File 'lib/amon/entity.rb', line 22 def metering_points @metering_points ||= metering_point_ids.map { |id| session.metering_point(id) } end |