Class: ActiveRedisStats::Count::Get
- Inherits:
-
Base
- Object
- Base
- Base
- ActiveRedisStats::Count::Get
show all
- Defined in:
- lib/active_redis_stats/count/get.rb
Class Method Summary
collapse
Methods inherited from Base
primary_key
Methods inherited from Base
all_key, all_keys, day_key, day_keys, expiration, hour_key, hour_keys, interval_key, month_key, month_keys, year_key, year_keys
Class Method Details
.total(key) ⇒ Object
8
9
10
11
12
|
# File 'lib/active_redis_stats/count/get.rb', line 8
def total(key)
ActiveRedisDB::String
.evaluate
.find(primary_key(key)) || 0
end
|
.total_intervals(key, format: :month, offset: 0) ⇒ Object
14
15
16
17
|
# File 'lib/active_redis_stats/count/get.rb', line 14
def total_intervals(key, format: :month, offset: 0)
keys = send("#{format}_keys", offset: offset)
keys.collect { |k| total("#{key}:#{k}") }
end
|