Class: GreenButtonClasses::MeterReading

Inherits:
GreenButtonEntry show all
Defined in:
lib/greenbutton/gb_classes.rb

Instance Attribute Summary collapse

Attributes inherited from GreenButtonEntry

#href_from_parent, #other_related, #related_hrefs

Instance Method Summary collapse

Methods inherited from GreenButtonEntry

#add_related_link, #additional_rules, #all_rules, #assign_rule, #create_attributes, #doc, #entry_node, #find_by_href, #get_related_links, #initialize

Constructor Details

This class inherits a constructor from GreenButtonClasses::GreenButtonEntry

Instance Attribute Details

#interval_blocksObject

Returns the value of attribute interval_blocks



205
206
207
# File 'lib/greenbutton/gb_classes.rb', line 205

def interval_blocks
  @interval_blocks
end

#reading_typeObject

Returns the value of attribute reading_type



205
206
207
# File 'lib/greenbutton/gb_classes.rb', line 205

def reading_type
  @reading_type
end

#usage_pointObject

Returns the value of attribute usage_point



205
206
207
# File 'lib/greenbutton/gb_classes.rb', line 205

def usage_point
  @usage_point
end

Instance Method Details

#add_related_entry(type, parser) ⇒ Object



212
213
214
215
216
217
218
219
220
221
# File 'lib/greenbutton/gb_classes.rb', line 212

def add_related_entry(type, parser)
  case type
  when 'reading_type'
    self.reading_type = parser
  when 'interval_block'
    self.interval_blocks << parser
  else
    warn 'Not a recognized relation for MeterReading'
  end
end

#pre_rule_assignment(parent) ⇒ Object



207
208
209
210
# File 'lib/greenbutton/gb_classes.rb', line 207

def pre_rule_assignment(parent)
  self.usage_point = parent
  self.interval_blocks = []
end