Class: TimingAttack::Spinner

Inherits:
Object
  • Object
show all
Defined in:
lib/timing_attack/spinner.rb

Constant Summary collapse

STATES =
%w(| / - \\)

Instance Method Summary collapse

Instance Method Details

#incrementObject



5
6
7
8
9
10
# File 'lib/timing_attack/spinner.rb', line 5

def increment
  @_spinner ||= 0
  print "\r #{STATES[@_spinner % STATES.length]}"
  @_spinner += 1
  @_spinner = 0 if @_spinner >= STATES.length
end