Sha256: edbe7ad170d05f426c948a4f9d9109691877382a66d5d5ea94e7184449536d40

Contents?: true

Size: 690 Bytes

Versions: 132

Compression:

Stored size: 690 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

132 entries across 131 versions & 14 rubygems

Version Path
distil-0.10.3 vendor/jsdoc-toolkit/app/frame/Reflection.js
distil-0.10.1 vendor/jsdoc-toolkit/app/frame/Reflection.js
distil-0.10.0 vendor/jsdoc-toolkit/app/frame/Reflection.js
sproutcore-1.0.1046 vendor/jsdoc/app/frame/Reflection.js
sproutcore-1.0.1043 vendor/jsdoc/app/frame/Reflection.js
distil-0.8.4 vendor/jsdoc-toolkit/app/frame/Reflection.js
distil-0.8.2 vendor/jsdoc-toolkit/app/frame/Reflection.js
distil-0.8.1 vendor/jsdoc-toolkit/app/frame/Reflection.js
ragaskar-jsdoc_helper-0.0.2.1 ext/jsdoc-toolkit/app/frame/Reflection.js
distil-0.8.0 vendor/jsdoc-toolkit/app/frame/Reflection.js
sproutcore-1.0.1042 vendor/jsdoc/app/frame/Reflection.js
distil-0.7.0 vendor/jsdoc-toolkit/app/frame/Reflection.js
sproutcore-1.0.1037 vendor/jsdoc/app/frame/Reflection.js
sproutcore-1.0.1035 vendor/jsdoc/app/frame/Reflection.js
sproutcore-1.0.1031 vendor/jsdoc/app/frame/Reflection.js
sproutcore-1.0.1030 vendor/jsdoc/app/frame/Reflection.js
sproutcore-1.0.1029 vendor/jsdoc/app/frame/Reflection.js
sproutcore-1.0.1027 vendor/jsdoc/app/frame/Reflection.js
sproutcore-1.0.1028 vendor/jsdoc/app/frame/Reflection.js
sproutcore-1.0.1026 vendor/jsdoc/app/frame/Reflection.js