Skip to content

Instantly share code, notes, and snippets.

@lutangar
Created October 21, 2014 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lutangar/ea016f1c0961e636b8b0 to your computer and use it in GitHub Desktop.
Save lutangar/ea016f1c0961e636b8b0 to your computer and use it in GitHub Desktop.
function Donut(name, flavor, description) {
this.id = _.uniqueId();
this.name = name || 'A random donut';
this.flavor = name || 'Default flavor';
this.description = '';
this.stuffed = false;
};
Donut.prototype.stuff = function (jam) {
this.stuffed = true;
};
Donut.prototype.toJson = function () {
return {
id: this.id,
name: this.name,
flavor: this.flavor,
position: this.position,
description: this.description,
stuffed: this.stuffed
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment