Class: GreenButtonClasses::MeterReading
- Inherits:
-
GreenButtonEntry
- Object
- GreenButtonEntry
- GreenButtonClasses::MeterReading
- Defined in:
- lib/greenbutton/gb_classes.rb
Instance Attribute Summary collapse
-
#interval_blocks ⇒ Object
Returns the value of attribute interval_blocks.
-
#reading_type ⇒ Object
Returns the value of attribute reading_type.
-
#usage_point ⇒ Object
Returns the value of attribute usage_point.
Attributes inherited from GreenButtonEntry
#href, #id, #other_related, #parent_href, #published, #related_hrefs, #title, #updated
Instance Method Summary collapse
Methods inherited from GreenButtonEntry
#additional_rules, #assign_rules, #doc, #find_by_href, #find_related_entries, #initialize, #parse_related_entry
Constructor Details
This class inherits a constructor from GreenButtonClasses::GreenButtonEntry
Instance Attribute Details
#interval_blocks ⇒ Object
Returns the value of attribute interval_blocks.
170 171 172 |
# File 'lib/greenbutton/gb_classes.rb', line 170 def interval_blocks @interval_blocks end |
#reading_type ⇒ Object
Returns the value of attribute reading_type.
170 171 172 |
# File 'lib/greenbutton/gb_classes.rb', line 170 def reading_type @reading_type end |
#usage_point ⇒ Object
Returns the value of attribute usage_point.
170 171 172 |
# File 'lib/greenbutton/gb_classes.rb', line 170 def usage_point @usage_point end |
Instance Method Details
#add_related(type, parser) ⇒ Object
177 178 179 180 181 182 183 184 185 186 |
# File 'lib/greenbutton/gb_classes.rb', line 177 def (type, parser) case type when 'reading_type' self.reading_type = parser when 'interval_block' self.interval_blocks << parser else raise 'Not a recognized relation for MeterReading' end end |
#pre_rule_assignment(parent) ⇒ Object
172 173 174 175 |
# File 'lib/greenbutton/gb_classes.rb', line 172 def pre_rule_assignment(parent) self.usage_point = parent self.interval_blocks = [] end |