alexa_rubykit 0.0.9 → 0.0.10
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/Gemfile.lock +2 -2
- data/README.md +1 -0
- data/lib/alexa_rubykit/response.rb +23 -2
- data/lib/alexa_rubykit/version.rb +1 -1
- metadata +3 -3
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: c869df61a86e4d9b36054e1470456344e6e28c1d
         | 
| 4 | 
            +
              data.tar.gz: dc5507f3e5b846a5f1f026757c5179e11b5f2ae3
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: e442fb944bb26ee7b746cfa6e385ab56b71cb29501bc05c503f0e3597b49dafb6b6e7d39ac197d225e20612231f918e1dad0ac828e2c539449c1125dca440a09
         | 
| 7 | 
            +
              data.tar.gz: 7bcc9198d4b088ed34c07a4a0b350f1b611b015d5b15ba5637c02fa9de3c40a265d0627fa3f51898fe6f0969a6982caecb42b37077c26a812066a130bf3ac928
         | 
    
        data/Gemfile.lock
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            PATH
         | 
| 2 2 | 
             
              remote: .
         | 
| 3 3 | 
             
              specs:
         | 
| 4 | 
            -
                alexa_rubykit (0.0. | 
| 4 | 
            +
                alexa_rubykit (0.0.10.pre.dev)
         | 
| 5 5 | 
             
                  bundler (~> 1.7)
         | 
| 6 6 | 
             
                  rake (~> 10.0)
         | 
| 7 7 | 
             
                  sinatra (~> 1.4)
         | 
| @@ -10,7 +10,7 @@ GEM | |
| 10 10 | 
             
              remote: https://rubygems.org/
         | 
| 11 11 | 
             
              specs:
         | 
| 12 12 | 
             
                diff-lcs (1.2.5)
         | 
| 13 | 
            -
                rack (1.6. | 
| 13 | 
            +
                rack (1.6.1)
         | 
| 14 14 | 
             
                rack-protection (1.5.3)
         | 
| 15 15 | 
             
                  rack
         | 
| 16 16 | 
             
                rake (10.4.2)
         | 
    
        data/README.md
    CHANGED
    
    | @@ -1,4 +1,5 @@ | |
| 1 1 | 
             
            # AlexaRubykit
         | 
| 2 | 
            +
            [](http://badge.fury.io/rb/alexa_rubykit)[](https://travis-ci.org/damianFC/alexa-rubykit)[](https://travis-ci.org/damianFC/alexa-rubykit)[](http://inch-ci.org/github/damianFC/alexa-rubykit)
         | 
| 2 3 |  | 
| 3 4 | 
             
            This gem implements a quick back-end service for deploying applications for Amazon's Echo (Alexa).
         | 
| 4 5 |  | 
| @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            module AlexaRubykit
         | 
| 2 2 | 
             
              class Response
         | 
| 3 3 | 
             
                require 'json'
         | 
| 4 | 
            -
                attr_accessor :version, :session, :response_object, :session_attributes, :speech, :response
         | 
| 4 | 
            +
                attr_accessor :version, :session, :response_object, :session_attributes, :speech, :response, :card
         | 
| 5 5 |  | 
| 6 6 | 
             
                # Every response needs a shouldendsession and a version attribute
         | 
| 7 7 | 
             
                # We initialize version to 1.0, use add_version to set your own.
         | 
| @@ -19,6 +19,27 @@ module AlexaRubykit | |
| 19 19 | 
             
                  @speech = { :type => 'PlainText', :text => speech_text }
         | 
| 20 20 | 
             
                  @speech
         | 
| 21 21 | 
             
                end
         | 
| 22 | 
            +
                #
         | 
| 23 | 
            +
                #"type": "string",
         | 
| 24 | 
            +
                #    "title": "string",
         | 
| 25 | 
            +
                #    "subtitle": "string",
         | 
| 26 | 
            +
                #    "content": "string"
         | 
| 27 | 
            +
                def add_card(type = nil, title = nil , subtitle = nil, content = nil)
         | 
| 28 | 
            +
                  # A Card must have a type which the default is Simple.
         | 
| 29 | 
            +
                  @card = Hash.new()
         | 
| 30 | 
            +
                  @card[:type] = 'Simple' if type.nil?
         | 
| 31 | 
            +
                  @card[:title] = title unless title.nil?
         | 
| 32 | 
            +
                  @card[:subtitle] = subtitle unless subtitle.nil?
         | 
| 33 | 
            +
                  @card[:content] = content unless content.nil?
         | 
| 34 | 
            +
                  @card
         | 
| 35 | 
            +
                end
         | 
| 36 | 
            +
             | 
| 37 | 
            +
                # The JSON Spec says order shouldn't matter.
         | 
| 38 | 
            +
                def add_hash_card(card)
         | 
| 39 | 
            +
                  card[:type] = 'Simple' if card[:type].nil?
         | 
| 40 | 
            +
                  @card = card
         | 
| 41 | 
            +
                  @card
         | 
| 42 | 
            +
                end
         | 
| 22 43 |  | 
| 23 44 | 
             
                # Adds a speech to the object, also returns a outputspeech object.
         | 
| 24 45 | 
             
                def say_response(speech, end_session = true)
         | 
| @@ -42,7 +63,7 @@ module AlexaRubykit | |
| 42 63 | 
             
                  @response = Hash.new
         | 
| 43 64 | 
             
                  @response[:outputSpeech] = @speech unless @speech.nil?
         | 
| 44 65 | 
             
                  # TODO: We need cards too
         | 
| 45 | 
            -
                   | 
| 66 | 
            +
                  @response[:card] = @card unless @card.nil?
         | 
| 46 67 | 
             
                  @response[:shouldEndSession] = session_end
         | 
| 47 68 | 
             
                  @response
         | 
| 48 69 | 
             
                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. | 
| 4 | 
            +
              version: 0.0.10
         | 
| 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- | 
| 11 | 
            +
            date: 2015-05-07 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| @@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 116 116 | 
             
                  version: '0'
         | 
| 117 117 | 
             
            requirements: []
         | 
| 118 118 | 
             
            rubyforge_project: 
         | 
| 119 | 
            -
            rubygems_version: 2.4. | 
| 119 | 
            +
            rubygems_version: 2.4.6
         | 
| 120 120 | 
             
            signing_key: 
         | 
| 121 121 | 
             
            specification_version: 4
         | 
| 122 122 | 
             
            summary: Alexa Ruby Kit
         |