Class: Aws::Lex::Conversation::Handler::Echo
- Defined in:
- lib/aws/lex/conversation/handler/echo.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#handle, #initialize, #will_respond?
Constructor Details
This class inherits a constructor from Aws::Lex::Conversation::Handler::Base
Instance Method Details
#response(conversation) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/aws/lex/conversation/handler/echo.rb', line 8 def response(conversation) content = .fetch(:content) { conversation.lex.input_transcript } content_type = .fetch(:content_type) { Type::Message::ContentType.new('PlainText') } fulfillment_state = .fetch(:fulfillment_state) { Type::FulfillmentState.new('Fulfilled') } conversation.close( fulfillment_state: fulfillment_state, messages: [ Type::Message.new( content: content, content_type: content_type ) ] ) end |