Skip to content

Instantly share code, notes, and snippets.

@trashhalo
Last active December 30, 2015 18:08
Show Gist options
  • Save trashhalo/7865203 to your computer and use it in GitHub Desktop.
Save trashhalo/7865203 to your computer and use it in GitHub Desktop.
(function() {
var Dancer = {
"start-dance": ["this"],
"stop-dance": ["this"]
};
var DancerImpl = (function() {
var record = function(dancing) {
return this.dancing = dancing;
};
record.prototype.$protocol = Dancer;
record.prototype.startDance = function() {
this.dancing = true;
return console.log("I am now dancing");
};
record.prototype.stopDance = function() {
this.dancing = false;
return console.log("I am no longer dancing");
};
return record;
})();
var d = new DancerImpl();
d.startDance();
return d.stopDance();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment