Sha256: d635ebe0b752cca465ee06de83ad69049ed193e33f57caf8311b65cc2edd02be

Contents?: true

Size: 803 Bytes

Versions: 7

Compression:

Stored size: 803 Bytes

Contents

module GreenButtonData
  class UsageSummary < Entry
    include Enumerations
    include Utilities

    attr_reader :billing_period,
                :overall_consumption_last_period

    attr_writer :commodity,
                :quality_of_reading

    def commodity
      if @commodity.is_a? Numeric
        COMMODITY[@commodity]
      elsif @commodity.is_a? Symbol
        @commodity
      end
    end

    def quality_of_reading
      if @quality_of_reading.is_a? Numeric
        QUALITY_OF_READING[@quality_of_reading]
      elsif @quality_of_reading.is_a? Symbol
        @quality_of_reading
      end
    end

    def status_timestamp(kwargs = {})
      epoch_to_time @status_time_stamp, kwargs
    end

    def to_s
      "#{@billing_period}: #{@overall_consumption_last_period}"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
green-button-data-0.4.2 lib/green-button-data/usage_summary.rb
green-button-data-0.4.1 lib/green-button-data/usage_summary.rb
green-button-data-0.3.2 lib/green-button-data/usage_summary.rb
green-button-data-0.4.0 lib/green-button-data/usage_summary.rb
green-button-data-0.4.0.alpha.pre.1 lib/green-button-data/usage_summary.rb
green-button-data-0.3.1 lib/green-button-data/usage_summary.rb
green-button-data-0.3.0 lib/green-button-data/usage_summary.rb