Class XhochY::Drossellog::DataCounter
In: xhochy/drossellog/datacounter.rb
Parent: Object
PageCounter EntryCounter ImpressionCounter DataCounter LogFileParser WeeklyReport CodeCounter MonthlyReport LogLine DailyReport DailyIPCounter IPCounter ImpressionBlacklist Drossellog XhochY dot/f_1.png

Counts the volume of data transferred

Methods

add   from_i   new   to_i  

Attributes

data  [R] 

Public Class methods

Creates a new DataCounter instance

[Source]

    # File xhochy/drossellog/datacounter.rb, line 8
 8:       def initialize
 9:         @data = 0
10:       end

Public Instance methods

Add the given size to the whole transfer amount

[Source]

    # File xhochy/drossellog/datacounter.rb, line 13
13:       def add(size)
14:         if size.class == Fixnum
15:           @data += size
16:         end
17:         
18:         if size.class == DataCounter
19:           @data += size.data
20:         end
21:       end

import data from a integer, overrides old data

[Source]

    # File xhochy/drossellog/datacounter.rb, line 29
29:       def from_i(data)
30:         @data = data
31:       end

return the relevant data as an integer

[Source]

    # File xhochy/drossellog/datacounter.rb, line 24
24:       def to_i
25:         @data
26:       end

[Validate]