Class | Annoy |
In: |
lib/annoy.rb
|
Parent: | Object |
answer | [RW] | |
factor | [RW] | |
flavor | [RW] | |
period | [RW] | |
system | [RW] | |
writer | [RW] |
Prints a question to writer and waits for a response on STDIN. It checks whether STDIN is connected a tty so it doesn‘t block on gets when there‘s no human around to annoy. It will return TRUE when STDIN is NOT connected to a tty (when STDIN.tty? returns false).
Returns true when the answer is correct, otherwise false.
Calling this method tells Annoy to not prompt for a response. All questions will return true.
Get a response from the user. Returns the string as typed by the user with extraneous whitespace removed.
NOTE: Annoy uses Highline to get user responses. If msg ends with a space character, Highline will not print a new line. If there is no space character Highline will print a new line.
Annoy.get_user_input("Password?") # => Password? # => 'user types here' Annoy.get_user_input("Password? ") # => Password? 'user types here'
Prints a question to writer and waits for a response on STDIN. It checks whether STDIN is connected a tty so it doesn‘t block on gets. when there‘s no human around to annoy. It will return TRUE when STDIN is NOT connected to a tty or if writer is nil.
Display msg for period seconds. NOTE: msg should be a short, single line. This is a naive approach which simply overwrites the current line.