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-2.0.1 lib/green-button-data/parser/interval_block.rb
green-button-data-2.0.0 lib/green-button-data/parser/interval_block.rb
green-button-data-1.0.3 lib/green-button-data/parser/interval_block.rb
green-button-data-1.0.1 lib/green-button-data/parser/interval_block.rb
green-button-data-1.0.0 lib/green-button-data/parser/interval_block.rb
green-button-data-0.7.5 lib/green-button-data/parser/interval_block.rb
green-button-data-0.7.4 lib/green-button-data/parser/interval_block.rb
green-button-data-0.7.3 lib/green-button-data/parser/interval_block.rb
green-button-data-0.7.2 lib/green-button-data/parser/interval_block.rb
green-button-data-0.7.1 lib/green-button-data/parser/interval_block.rb
green-button-data-0.7.0 lib/green-button-data/parser/interval_block.rb
green-button-data-0.6.0 lib/green-button-data/parser/interval_block.rb
green-button-data-0.5.0 lib/green-button-data/parser/interval_block.rb
green-button-data-0.4.2 lib/green-button-data/parser/interval_block.rb
green-button-data-0.4.1 lib/green-button-data/parser/interval_block.rb
green-button-data-0.3.2 lib/green-button-data/parser/interval_block.rb
green-button-data-0.4.0 lib/green-button-data/parser/interval_block.rb
green-button-data-0.4.0.alpha.pre.1 lib/green-button-data/parser/interval_block.rb
green-button-data-0.3.1 lib/green-button-data/parser/interval_block.rb
green-button-data-0.3.0 lib/green-button-data/parser/interval_block.rb