def ask(*args)
      options = args.last.kind_of?(Hash) ? args.pop : {}
      prompts = args.flatten.compact

      if block_given?
        logger.warn "You passed a block to #ask, but this functionality is not available in adhearsion-asr. If you're looking for the block validator functionality, you should avoid using it in favour of grammars, and it is deprecated in Adhearsion Core."
      end

      options[:grammar] || options[:grammar_url] || options[:limit] || options[:terminator] || raise(ArgumentError, "You must specify at least one of limit, terminator or grammar")

      grammars = AskGrammarBuilder.new(options).grammars

      output_document = prompts.empty? ? nil : output_formatter.ssml_for_collection(prompts)

      PromptBuilder.new(output_document, grammars, options).execute self
    end
def ask(*args)
      options = args.last.kind_of?(Hash) ? args.pop : {}
      prompts = args.flatten.compact

      if block_given?
        logger.warn "You passed a block to #ask, but this functionality is not available in adhearsion-asr. If you're looking for the block validator functionality, you should avoid using it in favour of grammars, and it is deprecated in Adhearsion Core."
      end

      options[:grammar] || options[:grammar_url] || options[:limit] || options[:terminator] || raise(ArgumentError, "You must specify at least one of limit, terminator or grammar")

      grammars = AskGrammarBuilder.new(options).grammars

      output_document = prompts.empty? ? nil : output_formatter.ssml_for_collection(prompts)

      PromptBuilder.new(output_document, grammars, options).execute self
    end
Prompts for input, handling playback of prompts, DTMF grammar construction, and execution

 @example A basic DTMF digit collection:
   ask "Welcome, ", "/opt/sounds/menu-prompt.mp3",
       timeout: 10, terminator: '#', limit: 3

 The first arguments will be a list of sounds to play, as accepted by #play, including strings for TTS, Date and Time objects, and file paths.
 :timeout, :terminator and :limit options may be specified to automatically construct a grammar, or grammars may be manually specified.

 @param [Object, Array<Object>] args A list of outputs to play, as accepted by #play
 @param [Hash] options Options to modify the grammar
 @option options [Boolean] :interruptible If the prompt should be interruptible or not. Defaults to true
 @option options [Integer] :limit Digit limit (causes collection to cease after a specified number of digits have been collected)
 @option options [Integer] :timeout Timeout in seconds before the first and between each input digit
 @option options [String] :terminator Digit to terminate input
 @option options [RubySpeech::GRXML::Grammar, Array<RubySpeech::GRXML::Grammar>] :grammar One of a collection of grammars to execute
 @option options [String, Array<String>] :grammar_url One of a collection of URLs for grammars to execute
 @option options [Hash] :input_options A hash of options passed directly to the Punchblock Input constructor. See
 @option options [Hash] :output_options A hash of options passed directly to the Punchblock Output constructor

 @return [Result] a result object from which the details of the utterance may be established

 @see Output#play
 @see http://rdoc.info/gems/punchblock/Punchblock/Component/Input.new Punchblock::Component::Input.new
 @see http://rdoc.info/gems/punchblock/Punchblock/Component/Output.new Punchblock::Component::Output.new