Module: DInstaller::CanAskQuestion
- Defined in:
- lib/dinstaller/can_ask_question.rb
Overview
Mixin providing a method to ask a question and wait
Instance Method Summary collapse
-
#ask(question) {|Question| ... } ⇒ Symbol, Object
Asks the given question and waits until the question is answered.
- #questions_manager ⇒ QuestionsManager
Instance Method Details
#ask(question) {|Question| ... } ⇒ Symbol, Object
Asks the given question and waits until the question is answered
39 40 41 42 43 44 45 46 |
# File 'lib/dinstaller/can_ask_question.rb', line 39 def ask(question) questions_manager.add(question) questions_manager.wait result = block_given? ? yield(question) : question.answer questions_manager.delete(question) result end |
#questions_manager ⇒ QuestionsManager
Note:
Classes including this mixin must define a #questions_manager method
|
# File 'lib/dinstaller/can_ask_question.rb', line 25
|