Object.prototype.attr_accessor = function (name,callBack) {
this[name] = function (value) {
if (value !== undefined) {
this['_'+name] = value;
callBack();
return this;
} else {
return this['_'+name];
};
};
return this;
};
Object.prototype.attr_reader = function (name) {
var name = arguments[i];
this[name] = function (value) {
return this['_'+name];
};
return this;
}
Object.prototype.attr_writer = function (name) {
this[name] = function (value) {
if (value !== undefined) {
this['_'+name] = value;
return this;
} else {
return undefined;
};
};
return this;
}
Object.prototype.attr_accessor = function (name,callBack) {
this[name] = function (value) {
if (value !== undefined) {
this['_'+name] = value;
callBack();
return this;
} else {
return this['_'+name];
};
};
return this;
};
Object.prototype.attr_reader = function (name) {
var name = arguments[i];
this[name] = function (value) {
return this['_'+name];
};
return this;
}
Object.prototype.attr_writer = function (name) {
this[name] = function (value) {
if (value !== undefined) {
this['_'+name] = value;
return this;
} else {
return undefined;
};
};
return this;
}