Class: Outlook2GCal::Counter
- Inherits:
-
Object
- Object
- Outlook2GCal::Counter
- Defined in:
- lib/outlook2gcal/counter.rb
Instance Attribute Summary collapse
-
#deletes ⇒ Object
Returns the value of attribute deletes.
-
#ignored ⇒ Object
Returns the value of attribute ignored.
-
#inserts ⇒ Object
Returns the value of attribute inserts.
-
#selects ⇒ Object
Returns the value of attribute selects.
-
#t_end ⇒ Object
Returns the value of attribute t_end.
-
#t_start ⇒ Object
Returns the value of attribute t_start.
-
#updates ⇒ Object
Returns the value of attribute updates.
Instance Method Summary collapse
- #end ⇒ Object
-
#initialize ⇒ Counter
constructor
A new instance of Counter.
- #runtime ⇒ Object
- #show ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ Counter
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
#deletes ⇒ Object
Returns the value of attribute deletes.
4 5 6 |
# File 'lib/outlook2gcal/counter.rb', line 4 def deletes @deletes end |
#ignored ⇒ Object
Returns the value of attribute ignored.
4 5 6 |
# File 'lib/outlook2gcal/counter.rb', line 4 def ignored @ignored end |
#inserts ⇒ Object
Returns the value of attribute inserts.
4 5 6 |
# File 'lib/outlook2gcal/counter.rb', line 4 def inserts @inserts end |
#selects ⇒ Object
Returns the value of attribute selects.
4 5 6 |
# File 'lib/outlook2gcal/counter.rb', line 4 def selects @selects end |
#t_end ⇒ Object
Returns the value of attribute t_end.
4 5 6 |
# File 'lib/outlook2gcal/counter.rb', line 4 def t_end @t_end end |
#t_start ⇒ Object
Returns the value of attribute t_start.
4 5 6 |
# File 'lib/outlook2gcal/counter.rb', line 4 def t_start @t_start end |
#updates ⇒ Object
Returns the value of attribute updates.
4 5 6 |
# File 'lib/outlook2gcal/counter.rb', line 4 def updates @updates end |
Instance Method Details
#end ⇒ Object
20 21 22 |
# File 'lib/outlook2gcal/counter.rb', line 20 def end @t_end = Time.now end |
#runtime ⇒ Object
14 15 16 |
# File 'lib/outlook2gcal/counter.rb', line 14 def runtime @t_end - @t_start end |
#show ⇒ Object
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 |
#start ⇒ Object
17 18 19 |
# File 'lib/outlook2gcal/counter.rb', line 17 def start @t_start = Time.now end |