28 lines
990 B
Ruby
28 lines
990 B
Ruby
|
module OrbitApp
|
||
|
module Module
|
||
|
module VisitorCounterEval
|
||
|
Version = "0.1"
|
||
|
|
||
|
def display_visitors(options={})
|
||
|
impressions = Impression.where(options).and(:referrer.ne => nil).distinct(:session_hash).count
|
||
|
end
|
||
|
|
||
|
def display_visitors_today
|
||
|
display_visitors(created_at: {'$gte' => Date.today.beginning_of_day, '$lte' => Date.today.end_of_day})
|
||
|
end
|
||
|
|
||
|
def display_visitors_this_week
|
||
|
display_visitors(created_at: {'$gte' => Date.today.beginning_of_week, '$lte' => Date.today.end_of_week})
|
||
|
end
|
||
|
|
||
|
def display_visitors_this_month
|
||
|
display_visitors(created_at: {'$gte' => Date.today.beginning_of_month, '$lte' => Date.today.end_of_month})
|
||
|
end
|
||
|
|
||
|
def display_visitors_this_year
|
||
|
display_visitors(created_at: {'$gte' => Date.today.beginning_of_year, '$lte' => Date.today.end_of_year})
|
||
|
end
|
||
|
end # end of VisitorCounterEval
|
||
|
end # of Module
|
||
|
end # of OrbitApp
|