alexa_rubykit 0.0.1 → 0.0.3

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
  SHA1:
3
- metadata.gz: 1f5d5359d1c4d7d5a871b3d4726dc51a803aafb5
4
- data.tar.gz: 4eff73b94c008dc9df5d46319d8e551953e59440
3
+ metadata.gz: 9249b23d07b28475be98519ab16d158cc4de9d3e
4
+ data.tar.gz: 14136962575fafb307233505f237a3f54ae61d81
5
5
  SHA512:
6
- metadata.gz: 86f49e1913012e0c302cb4f239526feac266f8de7fb56dbcf01d42598a666a3693dc42d1c9584695ec7bece9c212415d3552a54ef209a76683028d70aa0b7771
7
- data.tar.gz: 0c4018daeb77edc1172f8e351022431ade9bfe23dcbbc55de8fe759cdd73bfe9d7974c8d8a7a08167bc6bf19a59f214c1f85847056b9f2de31c376f7dd7f5d67
6
+ metadata.gz: 2ac721c33a454820dbfbab4e318abbe18ade32dce9111826ed5f6b2475ab488583182f3327a12b22aa8f63ab0fc7d63b7aeb801d187cbf536435b81ba904dff0
7
+ data.tar.gz: c36f4baa61587668c929e284fd33f71e22cb4f1a8c45057abf5f251de6652afe7b11b6e4772e75863799f500d244ec023fd15e3b22a2189185de8f6d5b273b45
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- alexa_rubykit (0.0.1)
4
+ alexa_rubykit (0.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -5,16 +5,15 @@ require 'sinatra'
5
5
  require 'json'
6
6
  require 'alexa_rubykit'
7
7
 
8
-
9
8
  enable :sessions
10
9
  post '/' do
11
10
  # Check that it's a valid Alexa request
12
11
  request_json = JSON.parse(request.body.read.to_s)
13
12
  halt 500 if request_json['session'].nil? || request_json['version'].nil? || request_json['request'].nil?
14
13
 
15
- request = AlexaRubykit::Request.new(request_json['request'])
16
- request.version = '1.0'
17
- request.should_end_session = true
18
- request.say_response('Hello, this is a test')
19
- request.build_response
14
+ request = AlexaRubykit::Request.new(request_json['request'])
15
+ request.version = '1.0'
16
+ request.shouldEndSession = true
17
+ request.say_response('Hello, this is a test')
18
+ request.build_response
20
19
  end
@@ -6,7 +6,7 @@ module AlexaRubykit
6
6
  class Request
7
7
  require 'json'
8
8
  require 'sinatra'
9
- attr_accessor :version, :session_attributes, :response, :should_end_session
9
+ attr_accessor :version, :session_attributes, :response, :shouldEndSession
10
10
 
11
11
  @request = ''
12
12
  @type = ''
@@ -26,13 +26,14 @@ module AlexaRubykit
26
26
  end
27
27
 
28
28
  # Builds a response.
29
+ # Takes the version, response and should_end_session variables and builds a JSON object.
29
30
  def build_response
30
31
  # Need to set all 3 parameters or the response is invalid
31
- halt 500 if @version.nil? || @response.nil? || @should_end_session.nil?
32
+ halt 500 if @version.nil? || @response.nil? || @shouldEndSession.nil?
32
33
  response = Hash.new
33
34
  response[:version] = @version
34
35
  response[:response] = @response
35
- response[:should_end_session] = @should_end_session
36
+ response[:shouldEndSession] = @shouldEndSession
36
37
  response.to_json
37
38
  end
38
39
 
@@ -1,3 +1,3 @@
1
1
  module AlexaRubykit
2
- VERSION = "0.0.1"
2
+ VERSION = '0.0.3'
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.1
4
+ version: 0.0.3
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-04-18 00:00:00.000000000 Z
11
+ date: 2015-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler