Sha256: b838b0e6c7d3a690b2b1b329a5b9d8b1c84cd2bb5ed00ed4ac90e60386d18cb2

Contents?: true

Size: 706 Bytes

Versions: 10

Compression:

Stored size: 706 Bytes

Contents

/**@constructor*/
function Reflection(obj) {
  this.obj = obj;
}

Reflection.prototype.getConstructorName = function() {
  if (this.obj.constructor.name) return this.obj.constructor.name;
  var src = this.obj.constructor.toSource();
  var name = src.substring(name.indexOf("function")+8, src.indexOf('(')).replace(/ /g,'');
  return name;
}

Reflection.prototype.getMethod = function(name) {
  for (var p in this.obj) {
    if (p == name && typeof(this.obj[p]) == "function") return this.obj[p];
  }
  return null;
}

Reflection.prototype.getParameterNames = function() {
  var src = this.obj.toSource();
  src = src.substring(
    src.indexOf("(", 8)+1, src.indexOf(")")
  );
  return src.split(/, ?/);
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
sproutcore-0.9.15 jsdoc/app/frame/Reflection.js
sproutcore-0.9.14 jsdoc/app/frame/Reflection.js
sproutcore-0.9.17 jsdoc/app/frame/Reflection.js
sproutcore-0.9.16 jsdoc/app/frame/Reflection.js
sproutcore-0.9.19 jsdoc/app/frame/Reflection.js
sproutcore-0.9.18 jsdoc/app/frame/Reflection.js
sproutcore-0.9.23 jsdoc/app/frame/Reflection.js
sproutcore-0.9.20 jsdoc/app/frame/Reflection.js
sproutcore-0.9.21 jsdoc/app/frame/Reflection.js
sproutcore-0.9.22 jsdoc/app/frame/Reflection.js