Class: R2do::UI
- Inherits:
-
Object
- Object
- R2do::UI
- Defined in:
- lib/r2do/ui.rb
Class Method Summary collapse
-
.input(message) ⇒ String
Accepts user input after displaying a message.
-
.new_line ⇒ void
Adds a new empty line on the display.
-
.rescue(exception) ⇒ void
Displays a status message to the user.
-
.status(message) ⇒ void
Displays a status message to the user.
Class Method Details
.input(message) ⇒ String
Accepts user input after displaying a message
47 48 49 50 51 |
# File 'lib/r2do/ui.rb', line 47 def self.input() print "#{} " $stdout.flush value = $stdin.gets.chomp end |
.new_line ⇒ void
This method returns an undefined value.
Adds a new empty line on the display
40 41 42 |
# File 'lib/r2do/ui.rb', line 40 def self.new_line() puts end |
.rescue(exception) ⇒ void
This method returns an undefined value.
Displays a status message to the user
33 34 35 |
# File 'lib/r2do/ui.rb', line 33 def self.rescue(exception) puts "abort: #{exception.}" end |
.status(message) ⇒ void
This method returns an undefined value.
Displays a status message to the user
25 26 27 |
# File 'lib/r2do/ui.rb', line 25 def self.status() puts end |