Skip to content

Instantly share code, notes, and snippets.

@cvan
Created December 6, 2013 00:01
Show Gist options
  • Save cvan/7816382 to your computer and use it in GitHub Desktop.
Save cvan/7816382 to your computer and use it in GitHub Desktop.
function Manifest(defaultObj) {
this.data = defaultObj || {};
}
Manifest.prototype.render = function() {
console.log(JSON.stringify(this.data));
};
Manifest.prototype.set = function(k, v) {
this.data[k] = v;
this.render();
};
Manifest.prototype.get = function(k) {
return this.data[k];
};
var manifest = new Manifest();
manifest.set('name', 'My App');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment