Skip to content

Instantly share code, notes, and snippets.

@rodrigo-x
Last active December 10, 2015 20:49
Show Gist options
  • Save rodrigo-x/4490923 to your computer and use it in GitHub Desktop.
Save rodrigo-x/4490923 to your computer and use it in GitHub Desktop.
Coisas antigas..
var Class = (function () {
var _private = {
i: 0,
get: (function () {
console.log("current value:" + this.i);
}),
set: (function (val) {
this.i = val;
}),
run: (function () {
console.log("running");
}),
jump: (function () {
console.log("jumping");
})
};
return {
facade: (function (args) {
_private.set(args.val);
_private.get();
if (args.run) {
_private.run();
}
if (args.jump) {
_private.jump();
}
})
};
})(Class);
Class.facade({
run: true,
jump: false,
val: 10
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment