Forces the current type to start scope.
/**
* @attribute convert
* @scope
* An object of name-function pairs that are used to convert attributes.
* Check out jQuery.Model.attributes
* for examples.
*/
convert: {
"date": function( str ) {
return typeof str == "string" ? (Date.parse(str) == NaN ? null : Date.parse(str)) : str
},
"number": function( val ) {
return parseFloat(val)
},
"boolean": function( val ) {
return Boolean(val)
}
}
In the example above the use of @scope forces date, number and boolean methods to be convert's children.