Sha256: 52fc611a31e26b208bfabb8aac0a954984900047eabd3869ca262f7085191aee
Contents?: true
Size: 641 Bytes
Versions: 15
Compression:
Stored size: 641 Bytes
Contents
JS.Ruby=function(d,b){b.call(new JS.Ruby.ClassBuilder(d))};JS.extend(JS.Ruby,{extendDSL:function(d,b){for(var a in b){if(d[a]||!JS.isFn(b[a]))continue;this.addMethod(d,b,a)}},addMethod:function(b,a,c){b[c]=function(){var d=a[c].apply(a,arguments);JS.Ruby.extendDSL(b,a);return d}},alias:function(c,e){return function(d,b){var a=c[b];if(a!==undefined)this.def(d,a);if(e)JS.Ruby.extendDSL(e,c)}},ClassBuilder:function(c){this.def=c.method('define');this.alias=JS.Ruby.alias(c.prototype);this.self={def:JS.bind(function(d,b){var a={};a[d]=b;c.extend(a);JS.Ruby.extendDSL(this,c)},this),alias:JS.Ruby.alias(c,this)};JS.Ruby.extendDSL(this,c)}});
Version data entries
15 entries across 15 versions & 2 rubygems