Class: Method

Method


new Method(handler, options)

Constructor for a Jayson Method

Parameters:
Name Type Argument Description
handler function <optional>
Function to set as handler
options Object <optional>
Properties
Name Type Argument Default Description
handler function <optional>
Same as separate handler
collect Boolean <optional>
true Params to the handler are collected in one object
params Array | Object <optional>
Defines params that the handler accepts
Source:

Methods


execute(server, requestParams, callback)

Executes this method in the context of a server

Parameters:
Name Type Description
server Server
requestParams Array | Object
callback function
Source:

getHandler()

Returns the handler function associated with this method

Source:
Returns:
Type
function

setHandler(handler)

Sets the handler function associated with this method

Parameters:
Name Type Description
handler function
Source: