class Ticker

Attributes

count[R]

Public Class Methods

new(count=0, opts={}) click to toggle source
# File lib/sqs_cli/ticker.rb, line 4
def initialize(count=0, opts={})
  @count = count
  @silent = opts.fetch(:silent, false)
  @start_time = Time.now
end

Public Instance Methods

increment() click to toggle source
# File lib/sqs_cli/ticker.rb, line 10
def increment
  print "." unless @silent
  @count += 1
end
uptime() click to toggle source
# File lib/sqs_cli/ticker.rb, line 15
def uptime
  @end_time = Time.now
  (@end_time - @start_time).round(2)
end