diff options
author | Abinoam Praxedes Marques Jr <abinoam@gmail.com> | 2015-06-03 23:41:17 -0300 |
---|---|---|
committer | Abinoam Praxedes Marques Jr <abinoam@gmail.com> | 2015-06-03 23:41:17 -0300 |
commit | 65843e749da3c5100f28b354ef465cf7d838553c (patch) | |
tree | 3c1ed53e1c86175d35d8e21a7ddd132d42cf36fe | |
parent | dcaf5d6a1a4f7970474db4ee9cf4e81f1886787a (diff) | |
download | highline-65843e749da3c5100f28b354ef465cf7d838553c.tar.gz |
Extract HighLine#confirm(question)
-rwxr-xr-x | lib/highline.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/highline.rb b/lib/highline.rb index b2d058e..ddf1ed0 100755 --- a/lib/highline.rb +++ b/lib/highline.rb @@ -537,7 +537,7 @@ class HighLine # need to add a layer of scope (new_scope) to ask a question inside a # question, without destroying instance data - raise NoConfirmationQuestionError unless new_scope.agree(question.confirm_question(self)) + raise NoConfirmationQuestionError unless confirm(question) end rescue NoConfirmationQuestionError @@ -585,6 +585,11 @@ class HighLine question.answer end + def confirm(question) + new_scope.agree(question.confirm_question(self)) + end + + public :ask_once # |