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:
-
config
Object-
url
Objectthe mojit proxy (parameter named to match Y.jsonrpc)
-
methods
Array(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:
-
rpc
RPC.Mojitorpc object
-
name
Stringname of method
-
force
Booleanpass 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:
-
method
Stringthe name of the function to execute via the mojitProxy
-
params
Arrayarray of arguments for the method
-
callback
Function | Object(optional) function to call on success or object specifying {context,on:{success,failure}}
mojito
-
proxy
-
method
-
params
-
callback
-
config
Parameters:
-
proxy
Objectthe mojit proxy
-
method
Stringthe name of the function to execute via the mojitProxy
-
params
Arrayarray of arguments for the method
-
callback
Function | Object(optional) function to call on success or object specifying {context,on:{success,failure}}
-
config
Objectconfig object passed to Y.RPC.Mojito constructo