About Pi Downloads Documentation Plugins Developer Forum Issues

pi.base.body

Summary

Prototype of the class will be created.

Syntax

pi.base.body = { memberName:memberValue, _PrivateMemberName:propertyValue };

Usage Example

>>> var product = new pi.base;
>>> product.init = function(_name,_price){
	this.environment.setName(_name).environment.setPrice(_price);
};
>>> product.body = {
	"sell":function(){
		//
	},
	"remove":function(){
		//
	},
	"environment":{
		"_name":"", "_price":"0$",
		"setPrice":function(_value){
			this._setPrice(_value+"$"); // Eger siz getter/setter olusturursaniz, pi olusturacagi methodun adinin onune underscore koyar.
		}
	}
};
>>> product = product.build();
>>> var bicycle = new product("bmx",1500);
>>> bicycle.environment.getPrice();
"1500$"
>>> bicycle.environment._price;
null