summaryrefslogtreecommitdiff
path: root/lib/highline/question_asker.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/highline/question_asker.rb')
-rw-r--r--lib/highline/question_asker.rb9
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/highline/question_asker.rb b/lib/highline/question_asker.rb
index 52f4959..03b3ff7 100644
--- a/lib/highline/question_asker.rb
+++ b/lib/highline/question_asker.rb
@@ -114,16 +114,11 @@ class HighLine
private
## Delegate to Highline
- def explain_error(error)
- @highline.say(error_final_response(error)) if error
+ def explain_error(explanation_key) # eg: :not_valid, :not_in_range
+ @highline.say(question.final_response(explanation_key))
@highline.say(question.ask_on_error_msg)
end
- def error_final_response(error)
- final_response = question.final_responses[error]
- final_response.call(question.answer) rescue final_response
- end
-
def gather_with_array
[].tap do |answers|
answers << ask_once