Code Monkey home page Code Monkey logo

alexa-rails's People

Contributors

tsrivishnu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

alexa-rails's Issues

Todos before first publish

  • Change the gem name to alexa-rails from alexa.
  • Add default intent handler classes: Cancel, Stop, Help etc..
  • Update documentation.

Dynamic view filename in intent response

Right now, by returning response in an intent handler renders the default speech.ssml.erb and display.text.erb. These files need to handle all the different conditions if the response needs to be different for different conditions. This will pollute the view file with some if clauses and sharing variables from intent. For example. Consider the following:

# Intent handler class
class Alexa::IntentHandlers::SaveBookmark < Alexa::IntentHandlers::Base
  attr_accessor :success
  def handle
     if some_condition
       @sucess = true
     else
       @success = false
     end
     return response
  end
end
# View - intent_handlers/save_bookmarks/speech.ssml.erb
<% if intent.success %>
   <s> You request is successfully processed. </s>
<% else %>
  <s>Unable to process your request.</s>
<% end %>

It would be nice if a the response method on intent handlers can accept the response filename argument so that there can be multiple view files for conditions.

In above example.

# Intent handler
def handle
     if some_condition
       @sucess = true
       return response(view_file: :success)
     else
       @success = false
       return response(view_file: :failure)
     end
  end
# View - intent_handlers/save_bookmarks/success.ssml.erb
   <s> You request is successfully processed. </s>
# View - intent_handlers/save_bookmarks/success.text.erb
   Succesfull. 

# View - intent_handlers/save_bookmarks/failure.ssml.erb
   <s> You request couldn't be processed. </s>
# View - intent_handlers/save_bookmarks/failure.text.erb
   Failed. Sorry!

A few fixes and upgrades

Howdy! I've been updating this library to get it functional with the latest API's in our fork. If you're still maintaining or using this library, I'd be happy to split them up into PR's and send them back your way.

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.