Class: GreenButtonData::ReadingType

Inherits:
Entry
  • Object
show all
Includes:
Enumerations
Defined in:
lib/green-button-data/reading_type.rb

Constant Summary

Constants included from Enumerations

Enumerations::ACCUMULATION, Enumerations::AUTHORIZATION_STATUS, Enumerations::COMMODITY, Enumerations::CURRENCY, Enumerations::DATA_CUSTODIAN_APPLICATION_STATUS, Enumerations::DATA_QUALIFIER, Enumerations::ESPI_SERVICE_STATUS, Enumerations::FLOW_DIRECTION, Enumerations::MEASUREMENT, Enumerations::PHASE_CODE, Enumerations::QUALITY_OF_READING, Enumerations::SERVICE, Enumerations::THIRD_PARTY_APPLICATION_STATUS, Enumerations::THIRD_PARTY_APPLICATION_TYPE, Enumerations::THIRD_PARTY_APPLICATION_USE, Enumerations::TIME_ATTRIBUTE, Enumerations::TIME_PERIOD_OF_INTEREST, Enumerations::UNIT_MULTIPLIER, Enumerations::UNIT_SYMBOL

Instance Attribute Summary collapse

Attributes inherited from Entry

#id, #token, #usage_point_id

Instance Method Summary collapse

Methods inherited from Entry

#initialize

Methods included from Utilities

#attributes_to_hash, #class_from_name, #epoch_to_time, #first_sunday_of, #last_weekday_of, #normalize_epoch, #nth_weekday_of, #parse_datetime, #weekday_offset

Methods included from Fetchable

included

Constructor Details

This class inherits a constructor from GreenButtonData::Entry

Instance Attribute Details

#consumption_tierObject (readonly)

Returns the value of attribute consumption_tier.



5
6
7
# File 'lib/green-button-data/reading_type.rb', line 5

def consumption_tier
  @consumption_tier
end

#cppObject (readonly)

Returns the value of attribute cpp.



5
6
7
# File 'lib/green-button-data/reading_type.rb', line 5

def cpp
  @cpp
end

#touObject (readonly)

Returns the value of attribute tou.



5
6
7
# File 'lib/green-button-data/reading_type.rb', line 5

def tou
  @tou
end

Instance Method Details

#accumulation_behaviourObject



7
8
9
# File 'lib/green-button-data/reading_type.rb', line 7

def accumulation_behaviour
  get_enum_symbol ACCUMULATION, @accumulation_behaviour
end

#commodityObject



11
12
13
# File 'lib/green-button-data/reading_type.rb', line 11

def commodity
  get_enum_symbol COMMODITY, @commodity
end

#currencyObject



15
16
17
# File 'lib/green-button-data/reading_type.rb', line 15

def currency
  get_enum_symbol CURRENCY, @currency
end

#data_qualifierObject



19
20
21
# File 'lib/green-button-data/reading_type.rb', line 19

def data_qualifier
  get_enum_symbol DATA_QUALIFIER, @data_qualifier
end

#default_qualityObject



23
24
25
# File 'lib/green-button-data/reading_type.rb', line 23

def default_quality
  get_enum_symbol QUALITY_OF_READING, @default_quality
end

#flow_directionObject



27
28
29
# File 'lib/green-button-data/reading_type.rb', line 27

def flow_direction
  get_enum_symbol FLOW_DIRECTION, @flow_direction
end

#interval_lengthObject



31
32
33
# File 'lib/green-button-data/reading_type.rb', line 31

def interval_length
  @interval_length
end

#kindObject



35
36
37
# File 'lib/green-button-data/reading_type.rb', line 35

def kind
  get_enum_symbol MEASUREMENT, @kind
end

#measuring_periodObject



39
40
41
# File 'lib/green-button-data/reading_type.rb', line 39

def measuring_period
  get_enum_symbol TIME_ATTRIBUTE, @measuring_period
end

#phaseObject



43
44
45
# File 'lib/green-button-data/reading_type.rb', line 43

def phase
  get_enum_symbol PHASE_CODE, @phase
end

#scale_factorObject



47
48
49
# File 'lib/green-button-data/reading_type.rb', line 47

def scale_factor
  10.0 ** @power_of_ten_multiplier
end

#time_attributeObject



51
52
53
# File 'lib/green-button-data/reading_type.rb', line 51

def time_attribute
  get_enum_symbol TIME_PERIOD_OF_INTEREST, @time_attribute
end

#to_hObject



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/green-button-data/reading_type.rb', line 62

def to_h
  {
    accumulation_behaviour: accumulation_behaviour,
    commodity: commodity,
    consumption_tier: consumption_tier,
    cpp: cpp,
    currency: currency,
    data_qualifier: data_qualifier,
    default_quality: default_quality,
    flow_direction: flow_direction,
    kind: kind,
    measuring_period: measuring_period,
    phase: phase,
    scale_factor: scale_factor,
    time_attribute: time_attribute,
    tou: tou,
    unit_of_measurement: unit_of_measurement
  }
end

#unit_of_measurementObject Also known as: unit, uom



55
56
57
# File 'lib/green-button-data/reading_type.rb', line 55

def unit_of_measurement
  get_enum_symbol UNIT_SYMBOL, @uom
end