Skip to content

Instantly share code, notes, and snippets.

@canonic-epicure
Created April 4, 2010 18:33
Show Gist options
  • Save canonic-epicure/355591 to your computer and use it in GitHub Desktop.
Save canonic-epicure/355591 to your computer and use it in GitHub Desktop.
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