Sha256: 991e5e6dd9330b556fa9f341375bec6d9f6ac63502a5fa75f49816374f7300ad

Contents?: true

Size: 822 Bytes

Versions: 25

Compression:

Stored size: 822 Bytes

Contents

module GreenButtonData
  module Parser
    class IntervalBlock
      include SAXMachine

      element :interval, class: Interval
      elements :IntervalReading, class: IntervalReading, as: :interval_readings

      def duration
        @interval.duration
      end

      def starts_at
        @interval.starts_at
      end

      def ends_at
        @interval.ends_at
      end

      # Standard ESPI namespacing
      element :'espi:interval', class: Interval, as: :interval
      elements :'espi:IntervalReading', class: IntervalReading,
              as: :interval_readings

      # Special case for PG&E which uses generic namespacing
      element :'ns0:interval', class: Interval, as: :interval
      elements :'ns0:IntervalReading', class: IntervalReading,
              as: :interval_readings
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
green-button-data-0.2.1 lib/green-button-data/parser/interval_block.rb
green-button-data-0.2.0 lib/green-button-data/parser/interval_block.rb
green-button-data-0.1.2 lib/green-button-data/parser/interval_block.rb
green-button-data-0.1.1 lib/green-button-data/parser/interval_block.rb
green-button-data-0.1.0 lib/green-button-data/parser/interval_block.rb