From fbadbac5c6046d4e6b86e3eaacb097b16d39b8bb Mon Sep 17 00:00:00 2001 From: Andrew Stewart Date: Thu, 31 Oct 2013 13:51:53 -0700 Subject: [PATCH] Small method rename --- dist/api/api.js | 8 ++++---- src/api/api.coffee | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/api/api.js b/dist/api/api.js index a431d8e..d506753 100644 --- a/dist/api/api.js +++ b/dist/api/api.js @@ -36,8 +36,8 @@ this.io = socketio.listen(this.server); this.server.get("/robots", this.getRobots); this.server.get("/robots/:robotid", this.getRobotByName); - this.server.get("/robots/:robotid/devices", this.getRobotDevices); - this.server.get("/robots/:robotid/devices/:deviceid", this.getRobotDeviceByName); + this.server.get("/robots/:robotid/devices", this.getDevices); + this.server.get("/robots/:robotid/devices/:deviceid", this.getDeviceByName); this.server.listen(this.port, this.host, function() { return Logger.info("" + _this.server.name + " is listening at " + _this.server.url); }); @@ -63,13 +63,13 @@ }); }; - Server.prototype.getRobotDevices = function(req, res, next) { + Server.prototype.getDevices = function(req, res, next) { return master.findRobot(req.params.robotid, function(err, robot) { return res.send(err ? err : robot.data().devices); }); }; - Server.prototype.getRobotDeviceByName = function(req, res, next) { + Server.prototype.getDeviceByName = function(req, res, next) { var deviceid, robotid; robotid = req.params.robotid; deviceid = req.params.deviceid; diff --git a/src/api/api.coffee b/src/api/api.coffee index 62a95e7..9db50c2 100644 --- a/src/api/api.coffee +++ b/src/api/api.coffee @@ -27,8 +27,8 @@ namespace "Api", -> @server.get "/robots", @getRobots @server.get "/robots/:robotid", @getRobotByName - @server.get "/robots/:robotid/devices", @getRobotDevices - @server.get "/robots/:robotid/devices/:deviceid", @getRobotDeviceByName + @server.get "/robots/:robotid/devices", @getDevices + @server.get "/robots/:robotid/devices/:deviceid", @getDeviceByName @server.listen @port, @host, => Logger.info "#{@server.name} is listening at #{@server.url}" @@ -40,11 +40,11 @@ namespace "Api", -> master.findRobot req.params.robotid, (err, robot) -> res.send if err then err else robot.data() - getRobotDevices: (req, res, next) -> + getDevices: (req, res, next) -> master.findRobot req.params.robotid, (err, robot) -> res.send if err then err else robot.data().devices - getRobotDeviceByName: (req, res, next) -> + getDeviceByName: (req, res, next) -> robotid = req.params.robotid deviceid = req.params.deviceid