Wallet/test/FakeStorage.js

26 lines
541 B
JavaScript
Raw Normal View History

2014-03-26 17:55:02 -03:00
var FakeStorage = function(){
this.storage = {};
};
2014-04-15 14:55:09 -03:00
FakeStorage.prototype.setGlobal = function (id, payload) {
2014-04-09 14:30:12 -03:00
this.storage[id] = payload;
2014-03-26 17:55:02 -03:00
};
2014-04-15 14:55:09 -03:00
FakeStorage.prototype.getGlobal = function(id) {
2014-04-09 14:30:12 -03:00
return this.storage[id];
2014-03-26 17:55:02 -03:00
}
2014-04-15 14:55:09 -03:00
FakeStorage.prototype.set = function (wid, id, payload) {
this.storage[wid + '-' + id] = payload;
};
FakeStorage.prototype.get = function(wid, id) {
return this.storage[wid + '-' +id];
}
FakeStorage.prototype.clear = function() {
delete this['storage'];
}
2014-03-26 17:55:02 -03:00
module.exports = require('soop')(FakeStorage);