Files
redistat/lib/redistat/result.rb
Jim Myhrberg 6d04d58d82 Redistat::Finder returns collections with results
within it properly, and all specs passing
2010-11-07 23:37:17 +00:00

23 lines
407 B
Ruby

module Redistat
class Result < ::Hash
attr_accessor :from
attr_accessor :till
alias :date :from
alias :date= :from=
def initialize(options = {})
@from = options[:from] ||= nil
@till = options[:till] ||= nil
end
def set_or_incr(key, value)
self[key] = 0 if !self.has_key?(key)
self[key] += value
self
end
end
end