UNPKG

dl

Version:

DreamLab Libs

38 lines (33 loc) 1.07 kB
/** * @overview GetFunctionListMethod * @copyright Dreamlab Onet.pl sp. z. o o 2012 */ var JsonRpcMethod = require('core').jsonrpc.JsonRpcMethod; var Event = require('core').event.Event; /** * @class GetFunctionListMethod * @classdesc GetFunctionListMethod * @extends JsonRpcMethod * * @requires JsonRpcMethod * @requires Event * * @return {GetFunctionListMethod} */ var GetFunctionListMethod = function (request, response, server) { JsonRpcMethod.call(this, request, response, server); }; GetFunctionListMethod.prototype = Object.create(JsonRpcMethod.prototype); /** * Returns methods list for interface * @param {Object} params * @return {undefined} * @method * @fires JsonRpcMethod.Event.OK */ GetFunctionListMethod.prototype.execute = function (params) { var interfaceName = this.server.getInterface(this._request); var methods = this.server.getMethods(interfaceName); this.dispatchEvent(new Event(JsonRpcMethod.Event.OK, methods)); }; exports.GetFunctionListMethod = GetFunctionListMethod;