Created
August 13, 2012 16:09
-
-
Save benshimmin/3342231 to your computer and use it in GitHub Desktop.
CoffeeScript classes and Node.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationBase | |
constructor : (arg1, arg2) -> | |
# do something with arg1, arg2 | |
@init() | |
init : => # override this | |
module.exports = ApplicationBase |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ApplicationBase = require "#{__dirname}/base" | |
class Main extends ApplicationBase | |
constructor : (arg1, arg2) -> super arg1, arg2 | |
init : => # overrides base init function | |
module.exports = Main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Main = require "#{__dirname}/main" | |
new Main "arg1", "arg2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment