def method_missing(method_sym, *arguments, &block)
      # Only refresh data if its more than 0.25 seconds old
      et = @last_read_timestamp.nil? ? 0 : (Time.now - @last_read_timestamp)
      @logger.debug "Elapsed time since last read #{et}"
      if et > 250
        @logger.info "More than 250 milliseconds have passed since last read. Triggering refresh."
        read()
      end

      if @values.include? method_sym
        @values[method_sym]
      else
        @logger.debug "method_missing failed to find #{method_sym} in the Meter.values cache"
        super
      end
    end
def method_missing(method_sym, *arguments, &block)
      # Only refresh data if its more than 0.25 seconds old
      et = @last_read_timestamp.nil? ? 0 : (Time.now - @last_read_timestamp)
      @logger.debug "Elapsed time since last read #{et}"
      if et > 250
        @logger.info "More than 250 milliseconds have passed since last read. Triggering refresh."
        read()
      end

      if @values.include? method_sym
        @values[method_sym]
      else
        @logger.debug "method_missing failed to find #{method_sym} in the Meter.values cache"
        super
      end
    end
def method_missing ( method_sym , * arguments , & block ) # Only refresh data if its more than 0.25 seconds old et = @last_read_timestamp . nil? ? 0 : ( Time . now - @last_read_timestamp ) @logger . debug "Elapsed time since last read #{et}" if et > 250 @logger . info "More than 250 milliseconds have passed since last read. Triggering refresh." read ( ) end if @values . include? method_sym @values [ method_sym ] else @logger . debug "method_missing failed to find #{method_sym} in the Meter.values cache" super end end
Attribute handler that delegates attribute reads to the values hash
Attribute handler that delegates attribute reads to the values hash