Class: Input::Prompt
- Inherits:
-
Object
- Object
- Input::Prompt
- Defined in:
- lib/xify/input/prompt.rb
Instance Method Summary collapse
-
#initialize(config) ⇒ Prompt
constructor
A new instance of Prompt.
- #updates ⇒ Object
Constructor Details
#initialize(config) ⇒ Prompt
Returns a new instance of Prompt.
5 6 7 |
# File 'lib/xify/input/prompt.rb', line 5 def initialize(config) = config['author'] end |
Instance Method Details
#updates ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/xify/input/prompt.rb', line 9 def updates loop do begin input = prompt unless input raise Interrupt end if input.length != 1 yield Event.new , input.chomp end rescue Interrupt raise end end end |