UNPKG

epitech-intranet

Version:

epitech intranet wrapper

69 lines (52 loc) 1.91 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.Module = (function(_super) { __extends(Module, _super); function Module() { this.index = __bind(this.index, this); this.router = __bind(this.router, this); this.setupRoutes = __bind(this.setupRoutes, this); Module.__super__.constructor.apply(this, arguments); } Module.prototype.setupRoutes = function() { return this.globalRoutes['module'] = this.router; }; Module.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.ModuleEntity); ue.module = fn; return ue; } }; Module.prototype.index = function(fn) { return fn({ "Method does not exists": "Method does not exists" }, {}); }; return Module; })(Model); module.exports.ModuleEntity = (function(_super) { __extends(ModuleEntity, _super); function ModuleEntity() { this.index = __bind(this.index, this); ModuleEntity.__super__.constructor.apply(this, arguments); } ModuleEntity.prototype.index = function(fn) { return this.request("module/" + this.module + "/", fn); }; return ModuleEntity; })(Model); }).call(this);