class MostPopular::Trending::TrendingStory

Public Class Methods

new(analytics) click to toggle source
# File lib/most-popular/trending.rb, line 5
def initialize(analytics)
  @analytics = analytics
end

Public Instance Methods

Private Instance Methods

dates_for(date) click to toggle source
# File lib/most-popular/trending.rb, line 19
def dates_for(date)
  #TODO consider moving logic to Analytics subclasses
  case date
  when :last_day
    return 'yesterday', 'today'
  when :last_week
    return '7daysAgo', 'today'
  else
    raise "I don't know what to do with #{date}"
  end
end