Skip to content

Instantly share code, notes, and snippets.

@darkwing
Created January 18, 2010 04:48
Show Gist options
  • Save darkwing/279789 to your computer and use it in GitHub Desktop.
Save darkwing/279789 to your computer and use it in GitHub Desktop.
Class.Mutators = {
Requires: function(items){
$splat(items).each(function(item){
if(!window[item] && Dependencies.Path) {
//inject file into page
new Element('script,{
src: Dependencies.Path + item + '.js',
type: 'text/javascript'
});
}
});
}
};
var MyClass = new Class({
options: {
option1: 1,
option2: 2
},
Implements: [Options,Events],
Requires: [DependencyClass1,DependencyClass2],
initialize: function(options) {
},
//other stuff
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment