Class: UserInput

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

Overview

will handle user input - will to quit the program, input from the console

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeUserInput

Returns a new instance of UserInput.



15
16
17
# File 'lib/KeeperChallenge.rb', line 15

def initialize
  exit = false
end

Instance Attribute Details

#exitObject

Returns the value of attribute exit.



14
15
16
# File 'lib/KeeperChallenge.rb', line 14

def exit
  @exit
end

Instance Method Details

#get_inputObject



19
20
21
22
23
# File 'lib/KeeperChallenge.rb', line 19

def get_input
  print '> '
  result = gets.chomp()
  return result
end