AlexaRuby
Originally forked from damianFC's AlexaRubykit, this gem implements a back-end service for interaction with Amazon Alexa API.
Installation
To install and use gem in your project just add this to your Gemfile:
gem 'alexa_ruby'
And bundle it with:
$ bundle install
Or install it as a separate gem:
$ gem install alexa_ruby
Usage
Gem provides methods to handle requests from Amazon Alexa skill and to sent it a proper response.
You can quickly try it with that sample code:
require 'alexa_ruby'
response = AlexaRuby::Response.new
response.add_speech('Yay, ruby is running!')
response.build_response
It will generate valid outspeech JSON:
{
"version": "1.0",
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "Yay, ruby is running!"
},
"shouldEndSession": true
}
}
Testing
Run the tests using
bundle exec rspec --color --format=documentation