Class: Outlook2GCal::Counter

Inherits:
Object
  • Object
show all
Defined in:
lib/outlook2gcal/counter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCounter

Returns a new instance of Counter.



6
7
8
9
10
11
12
13
# File 'lib/outlook2gcal/counter.rb', line 6

def initialize
  @updates = 0
  @inserts = 0
  @deletes = 0
  @selects = 0
  @ignored = 0      
  start
end

Instance Attribute Details

#deletesObject

Returns the value of attribute deletes.



4
5
6
# File 'lib/outlook2gcal/counter.rb', line 4

def deletes
  @deletes
end

#ignoredObject

Returns the value of attribute ignored.



4
5
6
# File 'lib/outlook2gcal/counter.rb', line 4

def ignored
  @ignored
end

#insertsObject

Returns the value of attribute inserts.



4
5
6
# File 'lib/outlook2gcal/counter.rb', line 4

def inserts
  @inserts
end

#selectsObject

Returns the value of attribute selects.



4
5
6
# File 'lib/outlook2gcal/counter.rb', line 4

def selects
  @selects
end

#t_endObject

Returns the value of attribute t_end.



4
5
6
# File 'lib/outlook2gcal/counter.rb', line 4

def t_end
  @t_end
end

#t_startObject

Returns the value of attribute t_start.



4
5
6
# File 'lib/outlook2gcal/counter.rb', line 4

def t_start
  @t_start
end

#updatesObject

Returns the value of attribute updates.



4
5
6
# File 'lib/outlook2gcal/counter.rb', line 4

def updates
  @updates
end

Instance Method Details

#endObject



20
21
22
# File 'lib/outlook2gcal/counter.rb', line 20

def end
  @t_end = Time.now
end

#runtimeObject



14
15
16
# File 'lib/outlook2gcal/counter.rb', line 14

def runtime
  @t_end - @t_start 
end

#showObject



23
24
25
26
27
28
29
30
31
32
33
# File 'lib/outlook2gcal/counter.rb', line 23

def show
  puts "\nStatistics:"
  puts "-"*20
  puts sprintf("Inserts    : %05d", @inserts)
  puts sprintf("Updates    : %05d", @updates)
  puts sprintf("Deletes    : %05d", @deletes)
  puts sprintf("Ingored    : %05d", @ignored)
  puts "-"*20
  puts sprintf("Total      : %05d", @selects)
  puts          "Runtime    : #{runtime} sec"
end

#startObject



17
18
19
# File 'lib/outlook2gcal/counter.rb', line 17

def start
  @t_start = Time.now
end