alexa_rubykit 0.0.11 → 0.0.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6bb6171d59540cf84093f975baadecce2e845ee1
4
- data.tar.gz: b283a2cf1d67ed6e51d43a223ebe2c96321c0827
3
+ metadata.gz: bee9c6a6f8480a626b66df8fa8bb865492bb56b0
4
+ data.tar.gz: b6c5221d6b40a50849642dcdcb8f6cb857c1dce0
5
5
  SHA512:
6
- metadata.gz: 973f24b4cd65410b41a85fd80eaac170f2e9383a5ec04d413670333fb96f3028d6494427ce04940dae1b3b0e4427444244a1c2f8aa1d058584c53ac89a879eb7
7
- data.tar.gz: edd21dda5ad14808798304018e85a09306dd41af059883d1d219fcd7ea72c29ea31ac5b6ed9a7769b67634da149a9b9770b524190a863495f609ab71dc8be2ba
6
+ metadata.gz: 4cbb8c2bb8bf470f0052f71fc034aec70ac9209465053dc08298c8f24f1a56d8fff312d70576d21518e7917223a29fec187a344f0df8cc9a8c6e3f1cb20e8e20
7
+ data.tar.gz: 403378a7588d55422dd2bb3790b0b4100e03eda7147a3f676f04886f14a78edaaa38d2cf4625e6762c7c3192050a337002de29a912624fc9daa8ebb2c81aad42
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- alexa_rubykit (0.0.11.pre.dev)
4
+ alexa_rubykit (0.0.12.pre.dev)
5
5
  bundler (~> 1.7)
6
6
  rake (~> 10.0)
7
7
  sinatra (~> 1.4)
data/lib/alexa_rubykit.rb CHANGED
@@ -3,6 +3,7 @@ require 'alexa_rubykit/version'
3
3
  require 'alexa_rubykit/response'
4
4
  require 'alexa_rubykit/intent_request'
5
5
  require 'alexa_rubykit/launch_request'
6
+ require 'alexa_rubykit/session_ended_request'
6
7
 
7
8
  module AlexaRubykit
8
9
  def self.print_json(json)
@@ -40,16 +40,18 @@ module AlexaRubykit
40
40
  end
41
41
  end
42
42
 
43
-
43
+ # Class that encapsulates each slot.
44
44
  class Slot
45
45
  attr_accessor :name, :value
46
46
 
47
+ # Each slot has a name and a value.
47
48
  def initialize(name, value)
48
49
  raise ArgumentError, 'Need a name and a value' if name.nil? || value.nil?
49
50
  @name = name
50
51
  @value = value
51
52
  end
52
53
 
54
+ # For better testing.
53
55
  def to_s
54
56
  "Slot Name: #{@name}, Value: #{value}"
55
57
  end
@@ -17,7 +17,7 @@ module AlexaRubykit
17
17
  when /Intent/
18
18
  @request = IntentRequest.new(json_request['request']['requestId'], json_request['request']['intent'])
19
19
  when /SessionEnded/
20
- 'SESSION_ENDED'
20
+ @request = SessionEndedRequest.new(json_request['request']['requestId'], json_request['request']['reason'])
21
21
  else
22
22
  raise ArgumentError, 'Invalid Request Type.'
23
23
  end
@@ -62,7 +62,6 @@ module AlexaRubykit
62
62
  def build_response_object(session_end = true)
63
63
  @response = Hash.new
64
64
  @response[:outputSpeech] = @speech unless @speech.nil?
65
- # TODO: We need cards too
66
65
  @response[:card] = @card unless @card.nil?
67
66
  @response[:shouldEndSession] = session_end
68
67
  @response
@@ -0,0 +1,19 @@
1
+ # Session end request class.
2
+ module AlexaRubykit
3
+ class SessionEndedRequest
4
+ attr_accessor :request_id, :reason, :type
5
+
6
+ # TODO: Validate the reason.
7
+ # We still don't know if all of the parameters in the request are required.
8
+ # Checking for the presence of intent on an IntentRequest.
9
+ def initialize(request_id, reason)
10
+ raise ArgumentError, 'Request ID should exist on a Session Ended Request.' if request_id.nil?
11
+ @type = 'SESSION_ENDED_REQUEST'
12
+ @request_id = request_id
13
+ @reason = reason
14
+ end
15
+ def to_s
16
+ "Session Ended for requestID: #{@request_id} with reason #{@reason}"
17
+ end
18
+ end
19
+ end
@@ -1,3 +1,3 @@
1
1
  module AlexaRubykit
2
- VERSION = '0.0.11'
2
+ VERSION = '0.0.12'
3
3
  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: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damian Finol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-10 00:00:00.000000000 Z
11
+ date: 2015-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -97,6 +97,7 @@ files:
97
97
  - lib/alexa_rubykit/launch_request.rb
98
98
  - lib/alexa_rubykit/request.rb
99
99
  - lib/alexa_rubykit/response.rb
100
+ - lib/alexa_rubykit/session_ended_request.rb
100
101
  - lib/alexa_rubykit/version.rb
101
102
  homepage: https://github.com/damianFC/alexa-rubykit
102
103
  licenses: