[OpenLayers-Commits] r12398 - in sandbox/jsdoc/jsd/OpenLayers: .
Food
commits-20090109 at openlayers.org
commits-20090109 at openlayers.org
Sat Sep 17 19:01:26 EDT 2011
Author: mpriour
Date: 2011-09-17 16:01:25 -0700 (Sat, 17 Sep 2011)
New Revision: 12398
Added:
sandbox/jsdoc/jsd/OpenLayers/Food.js
sandbox/jsdoc/jsd/OpenLayers/Food/
sandbox/jsdoc/jsd/OpenLayers/Food/Apple.js
sandbox/jsdoc/jsd/OpenLayers/Food/Banana.js
sandbox/jsdoc/jsd/OpenLayers/Food/Fruit.js
sandbox/jsdoc/jsd/OpenLayers/Food/Junk.js
Log:
Food and its subclasses for easier test cases for jsdoc
Added: sandbox/jsdoc/jsd/OpenLayers/Food/Apple.js
===================================================================
--- sandbox/jsdoc/jsd/OpenLayers/Food/Apple.js (rev 0)
+++ sandbox/jsdoc/jsd/OpenLayers/Food/Apple.js 2011-09-17 23:01:25 UTC (rev 12398)
@@ -0,0 +1,16 @@
+/**
+* @class
+* An Apple Fruit. This is a forbidden fruit, unless otherwise specified
+* @extends OpenLayers.Food.Fruit
+*/
+OpenLayers.Food.Apple=OpenLayers.Class(OpenLayers.Food.Fruit,{
+/** @scope OpenLayers.Food.Apple.prototype */
+/**
+* @default true
+* @property {Boolean}
+*/
+forbidden:true,
+onEat:function(){return {dead:true}},
+});
+
+
Added: sandbox/jsdoc/jsd/OpenLayers/Food/Banana.js
===================================================================
--- sandbox/jsdoc/jsd/OpenLayers/Food/Banana.js (rev 0)
+++ sandbox/jsdoc/jsd/OpenLayers/Food/Banana.js 2011-09-17 23:01:25 UTC (rev 12398)
@@ -0,0 +1,16 @@
+/**
+* @class
+* A banana fruit class. This fruit is not forbidden
+* @extends OpenLayers.Food.Fruit
+*/
+OpenLayers.Food.Banana=OpenLayers.Class(OpenLayers.Food.Fruit,{
+/** @scope OpenLayers.Food.Banana.prototype */
+/**
+ at default false
+ at property {Boolean}
+*/
+forbidden:false,
+onEat:function(){return {dead:false}},
+});
+
+
Added: sandbox/jsdoc/jsd/OpenLayers/Food/Fruit.js
===================================================================
--- sandbox/jsdoc/jsd/OpenLayers/Food/Fruit.js (rev 0)
+++ sandbox/jsdoc/jsd/OpenLayers/Food/Fruit.js 2011-09-17 23:01:25 UTC (rev 12398)
@@ -0,0 +1,28 @@
+/**
+* @class
+* A healthy fruit type food base class
+* Eating forbidden fruit makes you dead
+* @extends OpenLayers.Food
+*/
+OpenLayers.Food.Fruit = OpenLayers.Class(OpenLayers.Food,{
+/** @scope OpenLayers.Food.Fruit.prototype */
+/** @default true */
+healthy:true,
+/**
+* Is this forbidden fruit
+* @property {Boolean}
+*/
+forbidden:false,
+/**
+* Returns your health. Called by {OpenLayers.Food.eat}
+* @return {Object} Object with property 'dead' and {Boolean} value
+*/
+onEat:function(){},
+/**
+* @constructor OpenLayers.Food.Fruit
+* @param {Object} options - general options
+* @param {Boolean} forbidden - directly specify the forbidden status
+*/
+initialize:function(options,forbidden){}
+});
+
Added: sandbox/jsdoc/jsd/OpenLayers/Food/Junk.js
===================================================================
--- sandbox/jsdoc/jsd/OpenLayers/Food/Junk.js (rev 0)
+++ sandbox/jsdoc/jsd/OpenLayers/Food/Junk.js 2011-09-17 23:01:25 UTC (rev 12398)
@@ -0,0 +1,11 @@
+/**
+ at class
+Junk Food is not healthy
+ at extends OpenLayers.Food
+*/
+OpenLayers.Food.Junk = OpenLayers.Class(OpenLayers.Food,{
+/** @scope OpenLayers.Food.Junk.prototype */
+/** @default false */
+healthy:false
+});
+
Added: sandbox/jsdoc/jsd/OpenLayers/Food.js
===================================================================
--- sandbox/jsdoc/jsd/OpenLayers/Food.js (rev 0)
+++ sandbox/jsdoc/jsd/OpenLayers/Food.js 2011-09-17 23:01:25 UTC (rev 12398)
@@ -0,0 +1,40 @@
+/**
+* @class
+* The food for people to eat base class
+* @extends OpenLayers.Class
+*/
+OpenLayers.Food = OpenLayers.Class(OpenLayers.Class,
+{
+/**
+* Is this food healthy?
+ at type {Boolean}
+ at memberOf OpenLayers.Food.prototype
+*/
+healthy:true,
+/**
+* Color of food
+ at type {String}
+ at memberOf OpenLayers.Food.prototype
+*/
+color:null,
+/**
+* Current weight of the food
+ at type {Number}
+ at memberOf OpenLayers.Food.prototype
+*/
+size:null,
+/**
+* @constructor OpenLayers.Food
+ at memberOf OpenLayers.Food.prototype
+* @param {Object} options
+*/
+initialize:function(options){},
+/**
+* Eat the food
+* @param {Number} percent of food to eat 0-1 @default 0.1
+ at return {Number} remaining size of fruit
+ at memberOf OpenLayers.Food.prototype
+*/
+eat:function(amount){}
+});
+
More information about the Commits
mailing list