Class: ContextWrapper

ContextWrapper

new ContextWrapper(lambdaContext, succeedCallback, failCallback)

Wraps the lambda context object so that calls to succeed and fail to not directly fire but are delayed until later (when all post filters have completed)
Parameters:
Name Type Description
lambdaContext Object The lambda skill context object
succeedCallback Object The function to fire once succeed() is called
failCallback Object The function to fire once fail() is called
Source:

Methods

fail(response)

Overrides the lambda context fail function
Parameters:
Name Type Description
response String The skill response to return
Source:

getResponse() → {String}

Returns the response that was sent by the intent handler
Source:
Returns:
[he skill response
Type
String

getWrappedContext() → {Object}

Returns the context that is being wrapped
Source:
Returns:
The context that is being wrapped
Type
Object

isSucceed() → {Boolean}

Returns true if the type of response was of type succeed()
Source:
Returns:
True if succeed was called
Type
Boolean

responseOccurred() → {Boolean}

Returns true if succeed() or fail() was called. Useful for knowing if an intentHandler actually did anything
Source:
Returns:
true if succeed() or fail() was called
Type
Boolean

succeed(response)

Overrides the lambda context succeed function
Parameters:
Name Type Description
response String The skill response to return
Source: