class GreenButtonClasses::ElectricPowerUsageSummary

Constants

ATTRS

Attributes

usage_point[RW]

Public Instance Methods

additional_rules() click to toggle source
# File lib/greenbutton/gb_classes.rb, line 220
def additional_rules
  rules = [
    Rule.new(:bill_duration, ".//duration", :integer),
    Rule.new(:bill_start, ".//start", :unix_time),
    Rule.new(:last_power_ten, ".//overallConsumptionLastPeriod/powerOfTenMultiplier", :integer),
    Rule.new(:last_uom, ".//overallConsumptionLastPeriod/uom", :integer),
    Rule.new(:last_value, ".//overallConsumptionLastPeriod/value", :integer),
    Rule.new(:current_power_ten, ".//currentBillingPeriodOverAllConsumption/powerOfTenMultiplier", :integer),
    Rule.new(:current_uom, ".//currentBillingPeriodOverAllConsumption/uom", :integer),
    Rule.new(:current_value, ".//currentBillingPeriodOverAllConsumption/value", :integer),   
    Rule.new(:current_timestamp, ".//currentBillingPeriodOverAllConsumption/timeStamp", :unix_time)   
  ]
  ATTRS.each do |attr|
    rules << Rule.new( Helper.underscore(attr).to_sym, '//'+attr, :integer )
  end
  rules
end
pre_rule_assignment(parent) click to toggle source
# File lib/greenbutton/gb_classes.rb, line 216
def pre_rule_assignment(parent)
  self.usage_point = parent
end