alexa_rubykit 1.1.1 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/alexa_rubykit/response.rb +16 -0
- data/lib/alexa_rubykit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b55f0817b82435094b9bb1d5e8a3b0d7dba56b8c
|
4
|
+
data.tar.gz: ea253a35fc47c8cf8b8a93afe334ee1d8b4e7dce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcfc0800dd41e48f629ce94d3f7e50420604c279048e541b96cf35012730df46533c6adc845f7db2779a6049da904fbd5eff5ea3b56a15a12752005ce9dae858
|
7
|
+
data.tar.gz: 07e6cbc856421f5be8468b72c755707fc14ac4afc82a37091502120485810f4b77b80e2af36bc7eb2f2f835eaa5b6a9775e112df661b577347e0b255ccc8eb2c
|
@@ -8,6 +8,7 @@ module AlexaRubykit
|
|
8
8
|
def initialize(version = '1.0')
|
9
9
|
@session_attributes = Hash.new
|
10
10
|
@version = version
|
11
|
+
@directives = []
|
11
12
|
end
|
12
13
|
|
13
14
|
# Adds a key,value pair to the session object.
|
@@ -19,6 +20,20 @@ module AlexaRubykit
|
|
19
20
|
@speech = { :type => 'PlainText', :text => speech_text }
|
20
21
|
@speech
|
21
22
|
end
|
23
|
+
|
24
|
+
def add_audio_url(url, token='', offset=0)
|
25
|
+
@directives << {
|
26
|
+
'type' => 'AudioPlayer.Play',
|
27
|
+
'playBehavior' => 'REPLACE_ALL',
|
28
|
+
'audioItem' => {
|
29
|
+
'stream' => {
|
30
|
+
'token' => token,
|
31
|
+
'url' => url,
|
32
|
+
'offsetInMilliseconds' => offset
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
36
|
+
end
|
22
37
|
|
23
38
|
def add_reprompt(speech_text)
|
24
39
|
@reprompt = { "outputSpeech" => { :type => 'PlainText', :text => speech_text } }
|
@@ -75,6 +90,7 @@ module AlexaRubykit
|
|
75
90
|
def build_response_object(session_end = true)
|
76
91
|
@response = Hash.new
|
77
92
|
@response[:outputSpeech] = @speech unless @speech.nil?
|
93
|
+
@response[:directives] = @directives unless @directives.empty?
|
78
94
|
@response[:card] = @card unless @card.nil?
|
79
95
|
@response[:reprompt] = @reprompt unless session_end && @reprompt.nil?
|
80
96
|
@response[:shouldEndSession] = session_end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alexa_rubykit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Damian Finol
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|