2015-06-20 17:37:29 +03:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
|
|
var Cache = module.exports = function Cache() {
|
2016-02-02 21:55:02 +03:00
|
|
|
this._cache = {};
|
2015-08-11 21:06:32 +03:00
|
|
|
};
|
2015-06-20 17:37:29 +03:00
|
|
|
|
|
|
|
|
|
|
|
Cache.prototype.put = function Cache_put(key, value) {
|
2016-02-02 21:55:02 +03:00
|
|
|
this._cache[key] = value;
|
2015-06-20 17:37:29 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
Cache.prototype.get = function Cache_get(key) {
|
2016-02-02 21:55:02 +03:00
|
|
|
return this._cache[key];
|
2015-06-20 17:37:29 +03:00
|
|
|
};
|
2015-08-09 02:54:06 +03:00
|
|
|
|
|
|
|
|
|
|
|
Cache.prototype.del = function Cache_del(key) {
|
2016-02-02 21:55:02 +03:00
|
|
|
delete this._cache[key];
|
2015-08-20 00:54:05 +03:00
|
|
|
};
|
2016-02-28 04:16:48 +03:00
|
|
|
|
|
|
|
|
|
|
|
Cache.prototype.clear = function Cache_clear() {
|
|
|
|
this._cache = {};
|
|
|
|
};
|