class Aws::Lex::Conversation::Handler::SlotResolution

Public Instance Methods

response(conversation) click to toggle source
# File lib/aws/lex/conversation/handler/slot_resolution.rb, line 14
def response(conversation)
  # resolve all slots to their top resolution
  conversation.slots.values.each(&:resolve!)

  unless successor
    msg = 'Handler `SlotResolution` must not be the final handler in the chain'
    raise Exception::MissingHandler, msg
  end

  # call the next handler in the chain
  successor.handle(conversation)
end
will_respond?(conversation) click to toggle source
# File lib/aws/lex/conversation/handler/slot_resolution.rb, line 8
def will_respond?(conversation)
  # respond by default unless told otherwise
  callable = options.fetch(:respond_on) { ->(_c) { true } }
  callable.call(conversation)
end