transit-im
Version:
express-like framework for AIM bots creation (ICQ as well)
49 lines (38 loc) • 1.39 kB
JavaScript
// Generated by CoffeeScript 1.6.3
(function() {
var KnownProperties, Private, Request, _,
__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; },
__slice = [].slice;
_ = require('underscore');
Private = require('./private');
KnownProperties = {
'user': 'user',
'data': 'data',
'handlers': 'handlers',
'handler': 'handler',
'command': 'command'
};
Request = (function(_super) {
__extends(Request, _super);
function Request(user, data, handlers) {
Request.__super__.constructor.call(this, KnownProperties);
this.attr("user", user);
if (_.isObject(data)) {
this.attr("command", data.command);
} else {
this.attr("data", data);
}
this.attr("handlers", handlers);
}
Request.define = function() {
var newProperties;
newProperties = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
return newProperties.forEach(function(property) {
return Private.define(KnownProperties, property);
});
};
return Request;
})(Private);
module.exports = Request;
}).call(this);