Sha256: 5e0b1c7c47f46a163a8e431e6d1398a212d7485fd93d0cf71d9f1f1371b28a5d

Contents?: true

Size: 641 Bytes

Versions: 7

Compression:

Stored size: 641 Bytes

Contents

JS.Forwardable = new JS.Module('Forwardable', {
  defineDelegator: function(subject, method, alias, resolve) {
    alias = alias || method;
    this.define(alias, function() {
      var object   = this[subject],
          property = object[method];
      
      return JS.isFn(property)
          ? property.apply(object, arguments)
          : property;
    }, resolve !== false);
  },
  
  defineDelegators: function() {
    var methods = JS.array(arguments),
        subject = methods.shift(),
        i       = methods.length;
    
    while (i--) this.defineDelegator(subject, methods[i], methods[i], false);
    this.resolve();
  }
});

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
spontaneous-0.1.0.alpha1 application/js/vendor/JS.Class-2.1.5/src/forwardable.js
acts_as_dashboard-0.4.1 generators/dashboard/templates/js.class-2.1.4/src/forwardable.js
acts_as_dashboard-0.4.0 generators/dashboard/templates/js.class-2.1.4/src/forwardable.js
acts_as_dashboard-0.3.3 generators/dashboard/templates/js.class-2.1.4/src/forwardable.js
acts_as_dashboard-0.3.2 generators/dashboard/templates/js.class-2.1.4/src/forwardable.js
acts_as_dashboard-0.3.0 generators/dashboard/templates/js.class-2.1.4/src/forwardable.js
acts_as_dashboard-0.1.0 generators/dashboard/templates/js.class-2.1.4/src/forwardable.js