class AsciiParadise::RotatingSlash
Constants
- ARRAY
#¶ ↑
ARRAY
¶ ↑This constant is an Array that keeps the different tokens which will be displayed on the commandline.
Note that the last character in that array, the '/', will be the token that we will keep displayed.
There are six entries in this Array.
#¶ ↑
- BACKSPACE
#¶ ↑
BACKSPACE
¶ ↑#¶ ↑
- DEFAULT_DELAY
#¶ ↑
DEFAULT_DELAY
¶ ↑#¶ ↑
Public Class Methods
Public Instance Methods
can_we_finish?()
click to toggle source
delay?()
click to toggle source
reset()
click to toggle source
run()
click to toggle source
#¶ ↑
run¶ ↑
#¶ ↑
# File lib/ascii_paradise/animations/rotating_slash.rb, line 78 def run # ======================================================================= # # The tokens are those that will appear to "dance". # ======================================================================= # $stdout.sync = true # must be true else we won't see a thing. loop { print ARRAY.unshift(ARRAY.pop).last sleep delay? print BACKSPACE if can_we_finish? # Randomly finish here, via a message. show_finish_message break end } end