Sha256: 09a3f2e067a47befb9e9f01b2365d8df7a648d0b3090c6cda5af14633293b973
Contents?: true
Size: 720 Bytes
Versions: 7
Compression:
Stored size: 720 Bytes
Contents
/* --- script: Class.Binds.js name: Class.Binds description: Automagically binds specified methods in a class to the instance of the class. license: MIT-style license authors: - Aaron Newton requires: - Core/Class - /MooTools.More provides: [Class.Binds] ... */ Class.Mutators.Binds = function(binds){ if (!this.prototype.initialize) this.implement('initialize', function(){}); return Array.from(binds).concat(this.prototype.Binds || []); }; Class.Mutators.initialize = function(initialize){ return function(){ Array.from(this.Binds).each(function(name){ var original = this[name]; if (original) this[name] = original.bind(this); }, this); return initialize.apply(this, arguments); }; };
Version data entries
7 entries across 7 versions & 1 rubygems