epitech-intranet
Version:
epitech intranet wrapper
69 lines (52 loc) • 1.89 kB
JavaScript
// 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.Group = (function(_super) {
__extends(Group, _super);
function Group() {
this.index = __bind(this.index, this);
this.router = __bind(this.router, this);
this.setupRoutes = __bind(this.setupRoutes, this);
Group.__super__.constructor.apply(this, arguments);
}
Group.prototype.setupRoutes = function() {
return this.globalRoutes['group'] = this.router;
};
Group.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.GroupEntity);
ue.group = fn;
return ue;
}
};
Group.prototype.index = function(fn) {
return fn({
"Method does not exists": "Method does not exists"
}, {});
};
return Group;
})(Model);
module.exports.GroupEntity = (function(_super) {
__extends(GroupEntity, _super);
function GroupEntity() {
this.index = __bind(this.index, this);
GroupEntity.__super__.constructor.apply(this, arguments);
}
GroupEntity.prototype.index = function(fn) {
return this.request("group/" + this.group + "/", fn);
};
return GroupEntity;
})(Model);
}).call(this);