mirror of
https://github.com/jimeh/redistat.git
synced 2026-02-19 13:26:39 +00:00
23 lines
426 B
Ruby
23 lines
426 B
Ruby
module Redistat
|
|
class Result < HashWithIndifferentAccess
|
|
|
|
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 |