forked from bitovi/documentjs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscope.js
40 lines (40 loc) · 1021 Bytes
/
scope.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
steal.then(function() {
/**
* @class DocumentJS.tags.scope
* @tag documentation
* @parent DocumentJS.tags
*
* Forces the current type to start scope.
*
* ###Example:
*
* @codestart
* /**
* * @attribute convert
* * @scope
* * An object of name-function pairs that are used to convert attributes.
* * Check out [jQuery.Model.static.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)
* }
* }
* @codeend
*
* In the example above the use of @@scope forces __date__, __number__ and __boolean__ methods to be __convert's__ children.
*/
DocumentJS.tags.scope = {
add: function( line ) {
print("Scope! " + line)
this.starts_scope = true;
}
};
})