UNPKG

vatapi

Version:

vatapi.com API Nodejs library.

35 lines (27 loc) 869 B
(function() { var debug, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; debug = require('debug')('vatapi:BaseModel'); module.exports = (function() { function exports(client) { this.client = client; this._init = bind(this._init, this); this.load = bind(this.load, this); this._init(); } exports.prototype.load = function(model) { return require("./Models/" + model)(this.client); }; exports.prototype._init = function() { this.debug = require('debug')("vatapi:Models:" + this.constructor.name); this.get = this.client.get; this.post = this.client.post; this.put = this.client.put; this["delete"] = this.client["delete"]; if (this.init != null) { return this.init(); } }; return exports; })(); }).call(this);