Instantly share code, notes, and snippets.

Embed
What would you like to do?
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