Sha256: 6956eb4c30817c177858b204b13b365b8fa27c23a68bf80393407fb8491e4be6

Contents?: true

Size: 410 Bytes

Versions: 4

Compression:

Stored size: 410 Bytes

Contents

class QuestionWithLazyFullExplanation < SimpleDelegator
  def ask_and_wait_for_valid_response(&block)
    loop do
      @reask = false
      puts "#{question} #{options.shortcuts_string}"
      resp = Interactive::Response(options)
      puts options.shortcuts_meanings if resp.invalid?

      yield resp
      break if !resp.invalid? && @reask == false
    end
  end

  def reask!
    @reask = true
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
interactive-0.6.2 lib/interactive/question_with_lazy_full_explanation.rb
interactive-0.6.1 lib/interactive/question_with_lazy_full_explanation.rb
interactive-0.6.0 lib/interactive/question_with_lazy_full_explanation.rb
interactive-0.5.0 lib/interactive/question_with_lazy_full_explanation.rb