aws-lex-conversation 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ccdcefcf81f582ebc121ee3e0729ddd94db6384ff6111957cf2170d42af84ca5
4
- data.tar.gz: 602ed481532abb744b1242a387a37ea83dbcd6a6911a043b03d2140c93c6d0ec
3
+ metadata.gz: bb6d1313f30041f9896bccc30fe2511d7eb0f377f505dc3c3c8e153e2838151d
4
+ data.tar.gz: aa0804ca414e0c68d982ae8ba601a7f46a729678130babb56d7eb87edf119cd3
5
5
  SHA512:
6
- metadata.gz: af9068ec87608b0810961beb0a839c4e0d44a8332bf7ec2fe917ebc42b1e0907eaa237eaade909b344785facb4695406e84c9995c6c31c0bf1209637d2a339e5
7
- data.tar.gz: 92a833ede3d15611d9285781d472be3e0bbb245f7f8e7f2708a38bbfdfff5d1b88f57248929c7d3f57068752d8bba499c15b31804866013fa48afc2263aa6c89
6
+ metadata.gz: 3471ce6eddb122e71cb81aad093e663165bae469b8317c045eddb4f3ba21412ed3815e3f9e895aea121a6af61ae143abb15c0cff1520c10243bfe51a807b09b8
7
+ data.tar.gz: 906124b34ad1218de0c2725942620fc530120b855cf8e12552c8fc9b841fa18894a7327d92e908ff02e8e3bf276da7d1c4a951efcb87bb2c8f4dd19ecf057bc0
data/README.md CHANGED
@@ -58,13 +58,13 @@ The first handler that returns `true` for the `will_respond?` method will provid
58
58
  ```ruby
59
59
  class SayHello < Aws::Lex::Conversation::Handler::Base
60
60
  def will_respond?(conversation)
61
- conversation.lex.incovation_source.dialog_code_hook? && # callback is for DialogCodeHook (i.e. validation)
61
+ conversation.lex.invocation_source.dialog_code_hook? && # callback is for DialogCodeHook (i.e. validation)
62
62
  conversation.lex.current_intent.name == 'SayHello' && # Lex has routed to the 'SayHello' intent
63
- conversation.slots[:name] # our expected slot value is set
63
+ conversation.slots[:name].filled? # our expected slot value is set
64
64
  end
65
65
 
66
66
  def response(conversation)
67
- name = conversation.slots[:name]
67
+ name = conversation.slots[:name].value
68
68
 
69
69
  # NOTE: you can use the Type::* classes if you wish. The final output
70
70
  # will be normalized to a value that complies with the Lex response format.
@@ -45,7 +45,11 @@ module Aws
45
45
  end
46
46
 
47
47
  def elicitation_content
48
- first_elicitation? ? message : follow_up_message
48
+ first_elicitation? ? compose_message(message) : compose_message(follow_up_message)
49
+ end
50
+
51
+ def compose_message(msg)
52
+ msg.is_a?(Proc) ? msg.call(conversation) : msg
49
53
  end
50
54
 
51
55
  def increment_slot_elicitations!
@@ -3,7 +3,7 @@
3
3
  module Aws
4
4
  module Lex
5
5
  class Conversation
6
- VERSION = '1.1.2'
6
+ VERSION = '1.2.0'
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-lex-conversation
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jesse Doyle
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: exe
14
14
  cert_chain: []
15
- date: 2020-06-30 00:00:00.000000000 Z
15
+ date: 2020-07-22 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: shrink_wrap