method

ask_filtered

ruby latest stable - Class: Bundler::Thor::Shell::Basic

Method not available on this version

This method is only available on newer versions. The first available version (v2_6_3) is shown here.

ask_filtered(statement, color, options)
protected

No documentation available.

# File lib/bundler/vendor/thor/lib/thor/shell/basic.rb, line 424
      def ask_filtered(statement, color, options)
        answer_set = options[:limited_to]
        correct_answer = nil
        until correct_answer
          answers = answer_set.join(", ")
          answer = ask_simply("#{statement} [#{answers}]", color, options)
          correct_answer = answer_set.include?(answer) ? answer : nil
          say("Your response must be one of: [#{answers}]. Please try again.") unless correct_answer
        end
        correct_answer
      end