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.
3 4 5 |
# File 'lib/xify/input/prompt.rb', line 3 def initialize(config) = config['author'] end |
Instance Method Details
#updates ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/xify/input/prompt.rb', line 7 def updates loop do begin input = prompt unless input raise Interrupt end if input.length != 1 yield Xify::Event.new , input.chomp end rescue Interrupt raise end end end |