class Almicube::Bundler::DaysAgoBundler
Attributes
range[R]
Public Class Methods
new(options={})
click to toggle source
Calls superclass method
Almicube::Bundler::Base::new
# File lib/almicube/bundler/days_ago_bundler.rb, line 6 def initialize(options={}) @range = ( options[:range] || 1 ).to_i options[:name] ||= :"#{range}-days-ago" super options end
Public Instance Methods
keys()
click to toggle source
# File lib/almicube/bundler/days_ago_bundler.rb, line 12 def keys return [] unless has_ranking? range.times.map do |i| key = ranking.data_key key[:date] = key[:date] - (i+1).days key end end