Skip to content

Instantly share code, notes, and snippets.

@subtleGradient
Created September 6, 2008 01:05
Show Gist options
  • Select an option

  • Save subtleGradient/9065 to your computer and use it in GitHub Desktop.

Select an option

Save subtleGradient/9065 to your computer and use it in GitHub Desktop.
Class.Mutators.Binds = function(self, method_names) {
if( method_names === true){
method_names = [];
for (var property in self)
if(typeof self[property] == 'function')
method_names.push(property);
}
$splat(method_names).each(function(method_name){
var fn = self[method_name];
self[method_name] = function(){
return fn.apply(self, arguments);
};
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment