Class: Overcommit::UserInput
- Inherits:
-
Object
- Object
- Overcommit::UserInput
- Defined in:
- lib/overcommit/user_input.rb
Overview
Encapsulates prompting for and fetching input from a user.
Instance Method Summary collapse
-
#get ⇒ Object
Get a string of input from the user (up to the next newline character).
-
#initialize(io) ⇒ UserInput
constructor
A new instance of UserInput.
Constructor Details
#initialize(io) ⇒ UserInput
Returns a new instance of UserInput.
5 6 7 8 9 |
# File 'lib/overcommit/user_input.rb', line 5 def initialize(io) @io = io reopen_tty end |
Instance Method Details
#get ⇒ Object
Get a string of input from the user (up to the next newline character).
12 13 14 |
# File 'lib/overcommit/user_input.rb', line 12 def get @io.gets end |