lib/tropo-webapi-ruby/tropo-webapi-ruby.rb
def choices(params={})
      hash = build_action('choices', params)
      
      if @ask_hash
        @ask_hash[:ask].merge!(hash)
      elsif @nested_hash
        @nested_hash[@nested_name.to_sym].merge!(hash)
      else
        @response[:tropo] << hash
        render_response if @building.nil?
      end
    end
##
# Choices to give the user on input
#
# @param [Hash] params the options used to construct the grammar for the user
# @option params [String] :value this is the grammar which determines the type of expected data, such as [DIGITS]
# @option params [optional, String] :mode (ANY) the mode to use when asking the user [DTMF, SPEECH or ANY]
# @option params [optional, String] :terminator (#) the user may enter a keypad entry to stop the request
# @option [String, nil] the JSON string to be passed back to Tropo or nil
#   if the method has been called from inside a block
Choices to give the user on input
Choices to give the user on input
def choices(params={})
      hash = build_action('choices', params)
      if @ask_hash
        @ask_hash[:ask].merge!(hash)
      elsif @nested_hash
        @nested_hash[@nested_name.to_sym].merge!(hash)
      else
        @response[:tropo] << hash
        render_response if @building.nil?
      end
    end
def choices ( params = { } ) hash = build_action ( 'choices' , params ) if @ask_hash @ask_hash [ :ask ] . merge! ( hash ) elsif @nested_hash @nested_hash [ @nested_name . to_sym ] . merge! ( hash ) else @response [ :tropo ] << hash render_response if @building . nil? end end
Choices to give the user on input
Choices to give the user on input
params
:terminator (#) the user may enter a keypad entry to stop the request
: terminator ( # ) the user may enter a keypad entry to stop the request
the JSON string to be passed back to Tropo or nil if the method has been called from inside a block
the JSON string to be passed back to Tropo or nil if the method has been called from inside a block