class GreenButtonClasses::IntervalReading

Public Class Methods

new(reading_xml) click to toggle source
# File lib/greenbutton/gb_classes.rb, line 340
def initialize(reading_xml)
  @reading_xml = reading_xml
end

Public Instance Methods

duration() click to toggle source
# File lib/greenbutton/gb_classes.rb, line 352
def duration
  @reading_xml.xpath('./timePeriod/duration').text.to_i
end
end_time() click to toggle source
# File lib/greenbutton/gb_classes.rb, line 356
def end_time
  start_time + duration
end
start_time() click to toggle source
# File lib/greenbutton/gb_classes.rb, line 348
def start_time
  Time.at(@reading_xml.xpath('./timePeriod/start').text.to_i).utc
end
value() click to toggle source
# File lib/greenbutton/gb_classes.rb, line 344
def value
  @reading_xml.xpath('./value').text.to_f
end