Skip to content

Instantly share code, notes, and snippets.

@listrophy
Created September 25, 2012 19:31
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 listrophy/3783942 to your computer and use it in GitHub Desktop.
Save listrophy/3783942 to your computer and use it in GitHub Desktop.
Singleton class in Coffeescript
MainScreen = new class extends Screen
doSomething: (window) ->
window.buttons()[0].tap()
// Generated by CoffeeScript 1.3.3
var MainScreen,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
MainScreen = new ((function(_super) {
__extends(_Class, _super);
function _Class() {
return _Class.__super__.constructor.apply(this, arguments);
}
_Class.prototype.doSomething = function(window) {
return window.buttons()[0].tap();
};
return _Class;
})(Screen));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment