UNPKG

epitech-intranet

Version:

epitech intranet wrapper

86 lines (66 loc) 2.51 kB
// Generated by CoffeeScript 1.5.0 (function() { var Model, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __hasProp = {}.hasOwnProperty, __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; Model = require('../Model').Model; module.exports.Planning = (function(_super) { __extends(Planning, _super); function Planning() { this.load = __bind(this.load, this); this.calendar = __bind(this.calendar, this); this.index = __bind(this.index, this); this.router = __bind(this.router, this); this.setupRoutes = __bind(this.setupRoutes, this); Planning.__super__.constructor.apply(this, arguments); } Planning.prototype.setupRoutes = function() { this.router.calendar = this.calendar; this.router.load = this.load; return this.globalRoutes['planning'] = this.router; }; Planning.prototype.router = function(fn) { var ue; if (fn == null) { fn = null; } switch (typeof fn) { case 'function': return this.index(fn); case 'string': case 'number': ue = this.client.initModel(module.exports.PlanningEntity); ue.planning = fn; return ue; } }; Planning.prototype.index = function(fn) { return fn({ "Method does not exists": "Method does not exists" }, {}); }; Planning.prototype.calendar = function(fn) { return this.request("planning/calendar/", fn); }; Planning.prototype.load = function(fn) { return this.request("planning/load/", fn); }; return Planning; })(Model); module.exports.PlanningEntity = (function(_super) { __extends(PlanningEntity, _super); function PlanningEntity() { this.events = __bind(this.events, this); this.index = __bind(this.index, this); PlanningEntity.__super__.constructor.apply(this, arguments); } PlanningEntity.prototype.index = function(fn) { return this.request("planning/" + this.planning + "/", fn); }; PlanningEntity.prototype.events = function(fn) { return this.request("planning/" + this.planning + "/events/", fn); }; return PlanningEntity; })(Model); }).call(this);