| Class | XhochY::Drossellog::DailyIPCounter |
| In: |
xhochy/drossellog/dailyipcounter.rb
|
| Parent: | Object |
| users | [R] | The users(IP adresses) which made requests |
Creates a new IPCounter instance
# File xhochy/drossellog/dailyipcounter.rb, line 12
12: def initialize
13: @users = {
14: 'Sun' => IPCounter.new,
15: 'Mon' => IPCounter.new,
16: 'Tue' => IPCounter.new,
17: 'Wed' => IPCounter.new,
18: 'Thu' => IPCounter.new,
19: 'Fri' => IPCounter.new,
20: 'Sat' => IPCounter.new
21: }
22: end
Count another user, users are identified by their IP
# File xhochy/drossellog/dailyipcounter.rb, line 25
25: def add(day, data)
26: # we want the day as a string
27: if day.class == Fixnum
28: day = Time::RFC2822_DAY_NAME[day]
29: end
30:
31: if day != nil
32: @users[day].add data
33: end
34: end