This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2.1.5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SkillsController < ::ActionController::Base | |
def root | |
output = AlexaRubykit::Response.new | |
session_end = true | |
output.add_speech("Hello World") | |
render json: output.build_response(session_end) | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"intents": [ | |
{ | |
"intent": "UserInput", | |
"slots": [ | |
{ | |
"name": "Generic", | |
"type": "AMAZON.LITERAL" | |
} | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"intents": [ | |
{ | |
"intent": "AMAZON.YesIntent" | |
}, | |
{ | |
"intent": "AMAZON.NoIntent" | |
}, | |
{ | |
"intent": "AMAZON.CancelIntent" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'alexa_generator' | |
module Interactive | |
class AlexaModel | |
def self.get | |
@instance | |
end | |
def self.define(&block) | |
@instance = AlexaGenerator::InteractionModel.build do |model| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TaskPost {find me a handyman|Generic} | |
TaskPost {clean my house|Generic} | |
... many, many things here ... | |
TaskPost {wait in line|Generic} | |
TaskPost {ScheduleDate} | |
TaskPost {ScheduleDate} at {ScheduleTime} | |
TaskPost {ScheduleDate} {ScheduleTime} | |
TaskPost {ScheduleTime} | |
TaskPost {ScheduleTime} {ScheduleDate} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SkillsController < ::ActionController::Base | |
def root | |
input = AlexaRubykit.build_request(params) | |
output = AlexaRubykit::Response.new | |
session_end = true | |
message = "There was an error." # unknown thing happened | |
case input.type | |
when "LAUNCH_REQUEST" | |
# user talked to our skill but did not say something matching intent |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SkillsController < ::ActionController::Base | |
def root | |
input = AlexaRubykit.build_request(params) | |
output = AlexaRubykit::Response.new | |
session_end = false # probably going to keep going | |
message = "There was an error." # unknown thing happened | |
session = Session.find_or_initialize_by(session_id: input.session.session_id) | |
case input.type | |
when "LAUNCH_REQUEST" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// name the test something relevant | |
it("should create a new post", function* (driver, done) { | |
// stub the fetch request to get the initial lists of posts with commonly used json | |
server.get("/api/posts/tester", fixtures.home()); | |
// stub creation and set expectations of endpoint to create new post | |
server.post("/api/posts", | |
{id: 100, content: 'new post here', username: 'tester'}, // return this content | |
{content: 'new post here'} // expect this content | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To rewrite, or not to rewrite- that is the question: | |
Whether 'tis better for the product to suffer | |
The features and debt of outrageous history | |
Or to once again battle a sea of edge cases, | |
And by forgetting relive them. To wish- to hope- | |
No more; and by hope to say we end | |
The heartache, and the thousand unnatural cases | |
That code can error to. 'Tis a codebase | |
Devoutly to be wish'd. To wish- to hope. | |
To hope- perchance to rebuild: ay, there's the rub! |