Class: UserInput
- Inherits:
-
Object
- Object
- UserInput
- Defined in:
- lib/KeeperChallenge.rb
Overview
will handle user input - will to quit the program, input from the console
Instance Attribute Summary collapse
-
#exit ⇒ Object
Returns the value of attribute exit.
Instance Method Summary collapse
- #get_input ⇒ Object
-
#initialize ⇒ UserInput
constructor
A new instance of UserInput.
Constructor Details
#initialize ⇒ UserInput
Returns a new instance of UserInput.
15 16 17 |
# File 'lib/KeeperChallenge.rb', line 15 def initialize exit = false end |
Instance Attribute Details
#exit ⇒ Object
Returns the value of attribute exit.
14 15 16 |
# File 'lib/KeeperChallenge.rb', line 14 def exit @exit end |
Instance Method Details
#get_input ⇒ Object
19 20 21 22 23 |
# File 'lib/KeeperChallenge.rb', line 19 def get_input print '> ' result = gets.chomp() return result end |