Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var sys = require('sys');
- var Cache = require('./cache'),
- Database = require('./database'),
- Resource = require('./resource');
- Server = function(url) {
- Resource.call(this, url);
- };
- sys.inherits(Server, Resource);
- Server.prototype._all_dbs = function() {
- this.get.apply(this, this.arrayify(arguments).concat('_all_dbs'));
- };
- Server.prototype._uuids = function() {
- this.get.apply(this, this.arrayify(arguments).concat('_uuids'));
- };
- Server.prototype.database = function(dbName) {
- var url = this.uri.appendPath(dbName);
- return Database.fetch(url);
- };
- Server.fetch = function(url) {
- return Cache.fetch(url, function() {
- new Server(url);
- });
- };
- process.mixin(exports, Server);
Add Comment
Please, Sign In to add comment