RPC.Mojito Class
RPC wrapper for Mojit proxy. This allows you to use either
Y.RPC.JSON or Y.RPC.Mojito interchangeably. The method in the Mojit
proxy receives the parameters as an array in body.params.
You can pass this to the model as follows:
model.getItems.apply(model,
ac.params.getFromBody().params)
Constructor
RPC.Mojito
-
config
Parameters:
-
configObject-
urlObjectthe mojit proxy (parameter named to match Y.jsonrpc)
-
methodsArray(optional) method names, so you don't have to use
exec
-
Methods
addMethod
-
rpc -
name -
force
Adds the named method to the given rpc object.
Parameters:
-
rpcRPC.Mojitorpc object
-
nameStringname of method
-
forceBooleanpass true to override existing method
exec
-
method -
params -
callback
Executes the named method via the mojitProxy and invokes the callback when the result is received.
Parameters:
-
methodStringthe name of the function to execute via the mojitProxy
-
paramsArrayarray of arguments for the method
-
callbackFunction | Object(optional) function to call on success or object specifying {context,on:{success,failure}}
mojito
-
proxy -
method -
params -
callback -
config
Parameters:
-
proxyObjectthe mojit proxy
-
methodStringthe name of the function to execute via the mojitProxy
-
paramsArrayarray of arguments for the method
-
callbackFunction | Object(optional) function to call on success or object specifying {context,on:{success,failure}}
-
configObjectconfig object passed to Y.RPC.Mojito constructo
