Permalink
Browse files

Merge pull request #5 from burcu/master

Adding JavaScript filter to modify types with array representations into Google Closure docs format
  • Loading branch information...
2 parents 1a209f1 + 7cf95ad commit 4179703216c07e7cc804d9961ab672bf5d1951d8 @dashersw dashersw committed Apr 4, 2012
View
@@ -1,4 +1,5 @@
{
additionalDeps:['deps.js'],
+ nodeRequires: ['fs', 'path', 'hogan.js'], // Explicitly uses node require for given packages
closureBasePath:'third_party/tartJS/third_party/goog/goog/'
}
@@ -1,5 +1,3 @@
-// class
-
goog.provide('{{name}}');
{{#requires}}
goog.require('{{fullName}}');
@@ -14,7 +12,7 @@ __#inherits__
* @extends {__fullName__}
__/inherits__
__#parameters__
- * @param {__type__} __paramName__
+ * @param {__#type.array__Array.<__/type.array____type.name____#type.array__>__/type.array__} __paramName__
__/parameters__
*/
__name__ = function(__#iterator____.____/iterator__) {
@@ -35,12 +33,12 @@ __/inherits__
{{/inherits}}
{{#properties}}
-{{#cmp}}
- this.{{propName}} = new {{type}}();
-{{/cmp}}
-{{^cmp}}
+{{#type.cmp}}
+ this.{{propName}} = new {{type.name}}();
+{{/type.cmp}}
+{{^type.cmp}}
this.{{propName}};
-{{/cmp}}
+{{/type.cmp}}
{{/properties}}
};
{{#inherits}}
@@ -53,10 +51,10 @@ __#methods__
/**
*
__#parameters__
- * @param {__type__} __paramName__
+ * @param {__#type.array__Array.<__/type.array____type.name____#type.array__>__/type.array__} __paramName__
__/parameters__
__#returns__
- * @return {__returns__}
+ * @return {__#returns.array__Array.<__/returns.array____returns.name____#returns.array__>__/returns.array__} __paramName__
__/returns__
*/
__={{ }}=__
@@ -18,12 +18,19 @@ __={{ }}=__
{{/inherits}}
{{#properties}}
-{{#cmp}}
- this.{{propName}} = new {{type}}(data['{{propName}}']);
-{{/cmp}}
-{{^cmp}}
+{{#type.array}}
+ this.{{propName}} = goog.array.map(data['{{propName}}'], function(item) {
+ return new {{type.name}}(item);
+ });
+{{/type.array}}
+{{^type.array}}
+{{#type.cmp}}
+ this.{{propName}} = new {{type.name}}(data['{{propName}}']);
+{{/type.cmp}}
+{{^type.cmp}}
this.{{propName}} = data['{{propName}}'];
-{{/cmp}}
+{{/type.cmp}}
+{{/type.array}}
{{/properties}}
};
{{#inherits}}
@@ -36,10 +43,10 @@ __#methods__
/**
*
__#parameters__
- * @param {__type__} __paramName__
+ * @param {__#type.array__Array.<__/type.array____type.name____#type.array__>__/type.array__} __paramName__
__/parameters__
__#returns__
- * @return {__returns__}
+ * @return {__#returns.array__Array.<__/returns.array____returns.name____#returns.array__>__/returns.array__}
__/returns__
*/
__={{ }}=__
@@ -1,4 +1,4 @@
-var iterator = function () {
+var filterIterator = function () {
return function () {
var params = [];
goog.array.forEach(this.parameters, function (p) {
@@ -15,12 +15,13 @@ var javascript = {
},
class: {
filters: {
- iterator: iterator
+ iterator: filterIterator
+
}
},
entity: {
filters: {
- iterator: iterator
+ iterator: filterIterator
}
}
}

0 comments on commit 4179703

Please sign in to comment.