Created
April 4, 2010 18:33
-
-
Save canonic-epicure/355591 to your computer and use it in GitHub Desktop.
This file contains 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
Module('Some.Module', { | |
VERSION : 0.01, | |
use : { | |
'Some.Another.Module' : 0.01, | |
'Yet.Another.Module' : 0.03 | |
}, | |
EXPORT : [ 'func1', 'func2' ], | |
EXPORT_OK : [ 'func3', 'func4' ], | |
EXPORT_TAGS : { | |
':ALL' : [ 'func1', 'func2', 'func3', 'func4' ], | |
':SPECIAL' : [ 'func3', 'func4' ] | |
}, | |
body : function (our) { | |
//our == this == Some.Module here | |
our.func1 = function () { | |
} | |
our.func2 = function () { | |
} | |
// valid in Joose3 | |
Class('Some.Module', { | |
methods : { | |
someMethod : function (p) { | |
return our.func1(p) | |
} | |
} | |
}) | |
}}) | |
for pure OOP module, which do not export anything its simplified to: | |
Class('Some.Module', { | |
VERSION : 0.01, | |
use : { | |
'Some.Another.Module' : 0.01, | |
'Yet.Another.Module' : 0.03 | |
}, | |
methods : { | |
someMethod : function (p) { | |
... | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment