PageTemplate 2.1.7 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Changes +15 -0
- data/doc/classes/PageTemplate.html +203 -0
- data/doc/classes/PageTemplate.src/M000001.html +18 -0
- data/doc/classes/PageTemplate/BlockCommand.html +230 -0
- data/doc/classes/PageTemplate/BlockCommand.src/M000020.html +18 -0
- data/doc/classes/PageTemplate/BlockCommand.src/M000021.html +18 -0
- data/doc/classes/PageTemplate/BlockCommand.src/M000022.html +18 -0
- data/doc/classes/PageTemplate/BlockCommand.src/M000023.html +21 -0
- data/doc/classes/PageTemplate/BlockCommand.src/M000024.html +18 -0
- data/doc/classes/PageTemplate/CaseCommand.html +252 -0
- data/doc/classes/PageTemplate/CaseCommand.src/M000085.html +22 -0
- data/doc/classes/PageTemplate/CaseCommand.src/M000086.html +22 -0
- data/doc/classes/PageTemplate/CaseCommand.src/M000087.html +19 -0
- data/doc/classes/PageTemplate/CaseCommand.src/M000088.html +19 -0
- data/doc/classes/PageTemplate/CaseCommand.src/M000089.html +23 -0
- data/doc/classes/PageTemplate/CaseCommand.src/M000090.html +23 -0
- data/doc/classes/PageTemplate/Command.html +199 -0
- data/doc/classes/PageTemplate/Command.src/M000045.html +19 -0
- data/doc/classes/PageTemplate/Command.src/M000046.html +18 -0
- data/doc/classes/PageTemplate/CommentCommand.html +187 -0
- data/doc/classes/PageTemplate/CommentCommand.src/M000028.html +18 -0
- data/doc/classes/PageTemplate/CommentCommand.src/M000029.html +18 -0
- data/doc/classes/PageTemplate/CommentCommand.src/M000030.html +18 -0
- data/doc/classes/PageTemplate/DefaultGlossary.html +121 -0
- data/doc/classes/PageTemplate/DefaultPreprocessor.html +232 -0
- data/doc/classes/PageTemplate/DefaultPreprocessor.src/M000074.html +18 -0
- data/doc/classes/PageTemplate/DefaultPreprocessor.src/M000075.html +18 -0
- data/doc/classes/PageTemplate/DefaultPreprocessor.src/M000076.html +20 -0
- data/doc/classes/PageTemplate/DefaultPreprocessor.src/M000077.html +22 -0
- data/doc/classes/PageTemplate/DefaultPreprocessor.src/M000078.html +18 -0
- data/doc/classes/PageTemplate/DefineCommand.html +166 -0
- data/doc/classes/PageTemplate/DefineCommand.src/M000079.html +19 -0
- data/doc/classes/PageTemplate/DefineCommand.src/M000080.html +19 -0
- data/doc/classes/PageTemplate/FileSource.html +222 -0
- data/doc/classes/PageTemplate/FileSource.src/M000016.html +28 -0
- data/doc/classes/PageTemplate/FileSource.src/M000017.html +32 -0
- data/doc/classes/PageTemplate/FileSource.src/M000018.html +20 -0
- data/doc/classes/PageTemplate/FileSource.src/M000019.html +30 -0
- data/doc/classes/PageTemplate/FilterCommand.html +181 -0
- data/doc/classes/PageTemplate/FilterCommand.src/M000065.html +20 -0
- data/doc/classes/PageTemplate/FilterCommand.src/M000066.html +18 -0
- data/doc/classes/PageTemplate/FilterCommand.src/M000067.html +29 -0
- data/doc/classes/PageTemplate/HTGlossary.html +113 -0
- data/doc/classes/PageTemplate/IfCommand.html +261 -0
- data/doc/classes/PageTemplate/IfCommand.src/M000059.html +24 -0
- data/doc/classes/PageTemplate/IfCommand.src/M000060.html +22 -0
- data/doc/classes/PageTemplate/IfCommand.src/M000061.html +19 -0
- data/doc/classes/PageTemplate/IfCommand.src/M000062.html +20 -0
- data/doc/classes/PageTemplate/IfCommand.src/M000063.html +22 -0
- data/doc/classes/PageTemplate/IfCommand.src/M000064.html +36 -0
- data/doc/classes/PageTemplate/IncludeCommand.html +203 -0
- data/doc/classes/PageTemplate/IncludeCommand.src/M000039.html +18 -0
- data/doc/classes/PageTemplate/IncludeCommand.src/M000040.html +18 -0
- data/doc/classes/PageTemplate/IncludeCommand.src/M000041.html +35 -0
- data/doc/classes/PageTemplate/LoopCommand.html +260 -0
- data/doc/classes/PageTemplate/LoopCommand.src/M000011.html +24 -0
- data/doc/classes/PageTemplate/LoopCommand.src/M000012.html +20 -0
- data/doc/classes/PageTemplate/LoopCommand.src/M000013.html +22 -0
- data/doc/classes/PageTemplate/LoopCommand.src/M000014.html +77 -0
- data/doc/classes/PageTemplate/LoopCommand.src/M000015.html +21 -0
- data/doc/classes/PageTemplate/Namespace.html +163 -0
- data/doc/classes/PageTemplate/Namespace.src/M000057.html +20 -0
- data/doc/classes/PageTemplate/Namespace.src/M000058.html +22 -0
- data/doc/classes/PageTemplate/NamespaceItem.html +333 -0
- data/doc/classes/PageTemplate/NamespaceItem.src/M000002.html +18 -0
- data/doc/classes/PageTemplate/NamespaceItem.src/M000004.html +19 -0
- data/doc/classes/PageTemplate/NamespaceItem.src/M000006.html +84 -0
- data/doc/classes/PageTemplate/NamespaceItem.src/M000008.html +18 -0
- data/doc/classes/PageTemplate/NamespaceItem.src/M000009.html +22 -0
- data/doc/classes/PageTemplate/NamespaceItem.src/M000010.html +31 -0
- data/doc/classes/PageTemplate/Parser.html +369 -0
- data/doc/classes/PageTemplate/Parser.src/M000031.html +18 -0
- data/doc/classes/PageTemplate/Parser.src/M000032.html +32 -0
- data/doc/classes/PageTemplate/Parser.src/M000033.html +18 -0
- data/doc/classes/PageTemplate/Parser.src/M000034.html +30 -0
- data/doc/classes/PageTemplate/Parser.src/M000035.html +66 -0
- data/doc/classes/PageTemplate/Parser.src/M000036.html +18 -0
- data/doc/classes/PageTemplate/Parser.src/M000037.html +18 -0
- data/doc/classes/PageTemplate/Parser.src/M000038.html +19 -0
- data/doc/classes/PageTemplate/Preprocessor.html +123 -0
- data/doc/classes/PageTemplate/Source.html +165 -0
- data/doc/classes/PageTemplate/Source.src/M000055.html +18 -0
- data/doc/classes/PageTemplate/Source.src/M000056.html +18 -0
- data/doc/classes/PageTemplate/StackableCommand.html +205 -0
- data/doc/classes/PageTemplate/StackableCommand.src/M000081.html +17 -0
- data/doc/classes/PageTemplate/StackableCommand.src/M000082.html +18 -0
- data/doc/classes/PageTemplate/StackableCommand.src/M000083.html +18 -0
- data/doc/classes/PageTemplate/StackableCommand.src/M000084.html +18 -0
- data/doc/classes/PageTemplate/StringSource.html +163 -0
- data/doc/classes/PageTemplate/StringSource.src/M000053.html +23 -0
- data/doc/classes/PageTemplate/StringSource.src/M000054.html +18 -0
- data/doc/classes/PageTemplate/SyntaxGlossary.html +263 -0
- data/doc/classes/PageTemplate/SyntaxGlossary.src/M000047.html +22 -0
- data/doc/classes/PageTemplate/SyntaxGlossary.src/M000048.html +24 -0
- data/doc/classes/PageTemplate/SyntaxGlossary.src/M000049.html +18 -0
- data/doc/classes/PageTemplate/SyntaxGlossary.src/M000050.html +21 -0
- data/doc/classes/PageTemplate/SyntaxGlossary.src/M000051.html +21 -0
- data/doc/classes/PageTemplate/SyntaxGlossary.src/M000052.html +22 -0
- data/doc/classes/PageTemplate/Template.html +208 -0
- data/doc/classes/PageTemplate/Template.src/M000071.html +19 -0
- data/doc/classes/PageTemplate/Template.src/M000072.html +18 -0
- data/doc/classes/PageTemplate/Template.src/M000073.html +29 -0
- data/doc/classes/PageTemplate/TextCommand.html +185 -0
- data/doc/classes/PageTemplate/TextCommand.src/M000068.html +18 -0
- data/doc/classes/PageTemplate/TextCommand.src/M000069.html +18 -0
- data/doc/classes/PageTemplate/TextCommand.src/M000070.html +18 -0
- data/doc/classes/PageTemplate/UnknownCommand.html +191 -0
- data/doc/classes/PageTemplate/UnknownCommand.src/M000025.html +24 -0
- data/doc/classes/PageTemplate/UnknownCommand.src/M000026.html +18 -0
- data/doc/classes/PageTemplate/UnknownCommand.src/M000027.html +18 -0
- data/doc/classes/PageTemplate/ValueCommand.html +206 -0
- data/doc/classes/PageTemplate/ValueCommand.src/M000042.html +19 -0
- data/doc/classes/PageTemplate/ValueCommand.src/M000043.html +27 -0
- data/doc/classes/PageTemplate/ValueCommand.src/M000044.html +21 -0
- data/doc/created.rid +1 -0
- data/doc/files/README_txt.html +225 -0
- data/doc/files/lib/PageTemplate/case_rb.html +115 -0
- data/doc/files/lib/PageTemplate/commands_rb.html +111 -0
- data/doc/files/lib/PageTemplate/htglossary_rb.html +110 -0
- data/doc/files/lib/PageTemplate/parser_rb.html +111 -0
- data/doc/files/lib/PageTemplate_rb.html +139 -0
- data/doc/fr_class_index.html +52 -0
- data/doc/fr_file_index.html +32 -0
- data/doc/fr_method_index.html +116 -0
- data/doc/index.html +24 -0
- data/doc/rdoc-style.css +208 -0
- data/lib/PageTemplate.rb +1 -1
- data/lib/PageTemplate/commands.rb +49 -5
- data/lib/PageTemplate/parser.rb +57 -10
- data/tdata/include.txt +3 -0
- data/tdata/include2.txt +3 -0
- data/tdata/variable.txt +1 -0
- data/test.rb +83 -6
- metadata +159 -2
@@ -0,0 +1,21 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>to_s (PageTemplate::LoopCommand)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/PageTemplate/commands.rb, line 497</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
15
|
+
<span class="ruby-identifier">str</span> = <span class="ruby-node">"[ Loop: #{@value} "</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@commands</span>.<span class="ruby-identifier">to_s</span>
|
16
|
+
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">" Else: "</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@elseCommands</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@elseCommands</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
17
|
+
<span class="ruby-identifier">str</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">' ]'</span>
|
18
|
+
<span class="ruby-identifier">str</span>
|
19
|
+
<span class="ruby-keyword kw">end</span></pre>
|
20
|
+
</body>
|
21
|
+
</html>
|
@@ -0,0 +1,163 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: PageTemplate::Namespace</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">PageTemplate::Namespace</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/PageTemplate/parser_rb.html">
|
59
|
+
lib/PageTemplate/parser.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000058">construct_from</a>
|
90
|
+
<a href="#M000057">new</a>
|
91
|
+
</div>
|
92
|
+
</div>
|
93
|
+
|
94
|
+
</div>
|
95
|
+
|
96
|
+
|
97
|
+
<!-- if includes -->
|
98
|
+
<div id="includes">
|
99
|
+
<h3 class="section-bar">Included Modules</h3>
|
100
|
+
|
101
|
+
<div id="includes-list">
|
102
|
+
<span class="include-name"><a href="NamespaceItem.html">NamespaceItem</a></span>
|
103
|
+
</div>
|
104
|
+
</div>
|
105
|
+
|
106
|
+
<div id="section">
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
<!-- if method_list -->
|
116
|
+
<div id="methods">
|
117
|
+
<h3 class="section-bar">Public Class methods</h3>
|
118
|
+
|
119
|
+
<div id="method-M000058" class="method-detail">
|
120
|
+
<a name="M000058"></a>
|
121
|
+
|
122
|
+
<div class="method-heading">
|
123
|
+
<a href="Namespace.src/M000058.html" target="Code" class="method-signature"
|
124
|
+
onclick="popupCode('Namespace.src/M000058.html');return false;">
|
125
|
+
<span class="method-name">construct_from</span><span class="method-args">(arg)</span>
|
126
|
+
</a>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
<div class="method-description">
|
130
|
+
<p>
|
131
|
+
Create a new top-level <a href="Namespace.html">Namespace</a> with a
|
132
|
+
Hash-like object
|
133
|
+
</p>
|
134
|
+
</div>
|
135
|
+
</div>
|
136
|
+
|
137
|
+
<div id="method-M000057" class="method-detail">
|
138
|
+
<a name="M000057"></a>
|
139
|
+
|
140
|
+
<div class="method-heading">
|
141
|
+
<a href="Namespace.src/M000057.html" target="Code" class="method-signature"
|
142
|
+
onclick="popupCode('Namespace.src/M000057.html');return false;">
|
143
|
+
<span class="method-name">new</span><span class="method-args">(parent=nil,object=nil)</span>
|
144
|
+
</a>
|
145
|
+
</div>
|
146
|
+
|
147
|
+
<div class="method-description">
|
148
|
+
</div>
|
149
|
+
</div>
|
150
|
+
|
151
|
+
|
152
|
+
</div>
|
153
|
+
|
154
|
+
|
155
|
+
</div>
|
156
|
+
|
157
|
+
|
158
|
+
<div id="validator-badges">
|
159
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
</body>
|
163
|
+
</html>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>new (PageTemplate::Namespace)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/PageTemplate/parser.rb, line 164</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">parent</span>=<span class="ruby-keyword kw">nil</span>,<span class="ruby-identifier">object</span>=<span class="ruby-keyword kw">nil</span>)
|
15
|
+
<span class="ruby-ivar">@values</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
16
|
+
<span class="ruby-ivar">@parent</span> = <span class="ruby-identifier">parent</span>
|
17
|
+
<span class="ruby-ivar">@object</span> = <span class="ruby-identifier">object</span>
|
18
|
+
<span class="ruby-keyword kw">end</span></pre>
|
19
|
+
</body>
|
20
|
+
</html>
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html>
|
7
|
+
<head>
|
8
|
+
<title>construct_from (PageTemplate::Namespace)</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
11
|
+
</head>
|
12
|
+
<body class="standalone-code">
|
13
|
+
<pre><span class="ruby-comment cmt"># File lib/PageTemplate/parser.rb, line 171</span>
|
14
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-constant">Namespace</span>.<span class="ruby-identifier">construct_from</span>(<span class="ruby-identifier">arg</span>)
|
15
|
+
<span class="ruby-identifier">ns</span> = <span class="ruby-constant">Namespace</span>.<span class="ruby-identifier">new</span>()
|
16
|
+
<span class="ruby-identifier">arg</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
|
17
|
+
<span class="ruby-identifier">ns</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-identifier">v</span>
|
18
|
+
}
|
19
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ns</span>
|
20
|
+
<span class="ruby-keyword kw">end</span></pre>
|
21
|
+
</body>
|
22
|
+
</html>
|
@@ -0,0 +1,333 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: PageTemplate::NamespaceItem</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">PageTemplate::NamespaceItem</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/PageTemplate/parser_rb.html">
|
59
|
+
lib/PageTemplate/parser.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
<div id="description">
|
76
|
+
<p>
|
77
|
+
A <a href="Namespace.html">Namespace</a> object consists of three things:
|
78
|
+
</p>
|
79
|
+
<p>
|
80
|
+
parent: A parent object to get a value from if the namespace does not
|
81
|
+
‘know’ a value.
|
82
|
+
</p>
|
83
|
+
<p>
|
84
|
+
object: An object is a hash or list that contains the values that this
|
85
|
+
namespace will refer to. It may also be an object, in which case, its
|
86
|
+
methods are treated as a hash, with respond_to? and send()
|
87
|
+
</p>
|
88
|
+
<p>
|
89
|
+
Cache: A cache ensures that a method on an object will only be called once.
|
90
|
+
</p>
|
91
|
+
|
92
|
+
</div>
|
93
|
+
|
94
|
+
|
95
|
+
</div>
|
96
|
+
|
97
|
+
<div id="method-list">
|
98
|
+
<h3 class="section-bar">Methods</h3>
|
99
|
+
|
100
|
+
<div class="name-list">
|
101
|
+
<a href="#M000007">[]</a>
|
102
|
+
<a href="#M000005">[]=</a>
|
103
|
+
<a href="#M000002">clear</a>
|
104
|
+
<a href="#M000003">clear_cache</a>
|
105
|
+
<a href="#M000008">delete</a>
|
106
|
+
<a href="#M000006">get</a>
|
107
|
+
<a href="#M000009">parser</a>
|
108
|
+
<a href="#M000004">set</a>
|
109
|
+
<a href="#M000010">true?</a>
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
|
113
|
+
</div>
|
114
|
+
|
115
|
+
|
116
|
+
<!-- if includes -->
|
117
|
+
|
118
|
+
<div id="section">
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
<div id="attribute-list">
|
125
|
+
<h3 class="section-bar">Attributes</h3>
|
126
|
+
|
127
|
+
<div class="name-list">
|
128
|
+
<table>
|
129
|
+
<tr class="top-aligned-row context-row">
|
130
|
+
<td class="context-item-name">object</td>
|
131
|
+
<td class="context-item-value"> [RW] </td>
|
132
|
+
<td class="context-item-desc"></td>
|
133
|
+
</tr>
|
134
|
+
<tr class="top-aligned-row context-row">
|
135
|
+
<td class="context-item-name">parent</td>
|
136
|
+
<td class="context-item-value"> [RW] </td>
|
137
|
+
<td class="context-item-desc"></td>
|
138
|
+
</tr>
|
139
|
+
</table>
|
140
|
+
</div>
|
141
|
+
</div>
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
<!-- if method_list -->
|
146
|
+
<div id="methods">
|
147
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
148
|
+
|
149
|
+
<div id="method-M000007" class="method-detail">
|
150
|
+
<a name="M000007"></a>
|
151
|
+
|
152
|
+
<div class="method-heading">
|
153
|
+
<span class="method-name">[]</span><span class="method-args">(val,clean_rescue=true)</span>
|
154
|
+
</div>
|
155
|
+
|
156
|
+
<div class="method-description">
|
157
|
+
<p>
|
158
|
+
Alias for <a href="NamespaceItem.html#M000006">get</a>
|
159
|
+
</p>
|
160
|
+
</div>
|
161
|
+
</div>
|
162
|
+
|
163
|
+
<div id="method-M000005" class="method-detail">
|
164
|
+
<a name="M000005"></a>
|
165
|
+
|
166
|
+
<div class="method-heading">
|
167
|
+
<span class="method-name">[]=</span><span class="method-args">(key, value)</span>
|
168
|
+
</div>
|
169
|
+
|
170
|
+
<div class="method-description">
|
171
|
+
<p>
|
172
|
+
Alias for <a href="NamespaceItem.html#M000004">set</a>
|
173
|
+
</p>
|
174
|
+
</div>
|
175
|
+
</div>
|
176
|
+
|
177
|
+
<div id="method-M000002" class="method-detail">
|
178
|
+
<a name="M000002"></a>
|
179
|
+
|
180
|
+
<div class="method-heading">
|
181
|
+
<a href="NamespaceItem.src/M000002.html" target="Code" class="method-signature"
|
182
|
+
onclick="popupCode('NamespaceItem.src/M000002.html');return false;">
|
183
|
+
<span class="method-name">clear</span><span class="method-args">()</span>
|
184
|
+
</a>
|
185
|
+
</div>
|
186
|
+
|
187
|
+
<div class="method-description">
|
188
|
+
<p>
|
189
|
+
Clears the cache
|
190
|
+
</p>
|
191
|
+
</div>
|
192
|
+
</div>
|
193
|
+
|
194
|
+
<div id="method-M000003" class="method-detail">
|
195
|
+
<a name="M000003"></a>
|
196
|
+
|
197
|
+
<div class="method-heading">
|
198
|
+
<span class="method-name">clear_cache</span><span class="method-args">()</span>
|
199
|
+
</div>
|
200
|
+
|
201
|
+
<div class="method-description">
|
202
|
+
<p>
|
203
|
+
Alias for <a href="NamespaceItem.html#M000002">clear</a>
|
204
|
+
</p>
|
205
|
+
</div>
|
206
|
+
</div>
|
207
|
+
|
208
|
+
<div id="method-M000008" class="method-detail">
|
209
|
+
<a name="M000008"></a>
|
210
|
+
|
211
|
+
<div class="method-heading">
|
212
|
+
<a href="NamespaceItem.src/M000008.html" target="Code" class="method-signature"
|
213
|
+
onclick="popupCode('NamespaceItem.src/M000008.html');return false;">
|
214
|
+
<span class="method-name">delete</span><span class="method-args">(key)</span>
|
215
|
+
</a>
|
216
|
+
</div>
|
217
|
+
|
218
|
+
<div class="method-description">
|
219
|
+
<p>
|
220
|
+
Removes an entry from the <a href="Namespace.html">Namespace</a>
|
221
|
+
</p>
|
222
|
+
</div>
|
223
|
+
</div>
|
224
|
+
|
225
|
+
<div id="method-M000006" class="method-detail">
|
226
|
+
<a name="M000006"></a>
|
227
|
+
|
228
|
+
<div class="method-heading">
|
229
|
+
<a href="NamespaceItem.src/M000006.html" target="Code" class="method-signature"
|
230
|
+
onclick="popupCode('NamespaceItem.src/M000006.html');return false;">
|
231
|
+
<span class="method-name">get</span><span class="method-args">(val,clean_rescue=true)</span>
|
232
|
+
</a>
|
233
|
+
</div>
|
234
|
+
|
235
|
+
<div class="method-description">
|
236
|
+
<p>
|
237
|
+
Returns the first value found for <tt>key</tt> in the nested namespaces.
|
238
|
+
Returns nil if no value is found.
|
239
|
+
</p>
|
240
|
+
<p>
|
241
|
+
Values are checked for in this order through each level of namespace:
|
242
|
+
</p>
|
243
|
+
<ul>
|
244
|
+
<li>level.key
|
245
|
+
|
246
|
+
</li>
|
247
|
+
<li>level.key()
|
248
|
+
|
249
|
+
</li>
|
250
|
+
<li>level[key]
|
251
|
+
|
252
|
+
</li>
|
253
|
+
</ul>
|
254
|
+
<p>
|
255
|
+
If a value is not found in any of the nested namespaces, get() searches for
|
256
|
+
the key in the global namespace.
|
257
|
+
</p>
|
258
|
+
<p>
|
259
|
+
If <tt>val</tt> is a dot-separated list of words, then ‘key’ is
|
260
|
+
the first part of it. The remainder of the words are sent to key (and
|
261
|
+
further results) to premit accessing attributes of objects.
|
262
|
+
</p>
|
263
|
+
</div>
|
264
|
+
</div>
|
265
|
+
|
266
|
+
<div id="method-M000009" class="method-detail">
|
267
|
+
<a name="M000009"></a>
|
268
|
+
|
269
|
+
<div class="method-heading">
|
270
|
+
<a href="NamespaceItem.src/M000009.html" target="Code" class="method-signature"
|
271
|
+
onclick="popupCode('NamespaceItem.src/M000009.html');return false;">
|
272
|
+
<span class="method-name">parser</span><span class="method-args">()</span>
|
273
|
+
</a>
|
274
|
+
</div>
|
275
|
+
|
276
|
+
<div class="method-description">
|
277
|
+
<p>
|
278
|
+
parser: most namespace objects won’t be a parser, but pass this query
|
279
|
+
up to the parser object.
|
280
|
+
</p>
|
281
|
+
</div>
|
282
|
+
</div>
|
283
|
+
|
284
|
+
<div id="method-M000004" class="method-detail">
|
285
|
+
<a name="M000004"></a>
|
286
|
+
|
287
|
+
<div class="method-heading">
|
288
|
+
<a href="NamespaceItem.src/M000004.html" target="Code" class="method-signature"
|
289
|
+
onclick="popupCode('NamespaceItem.src/M000004.html');return false;">
|
290
|
+
<span class="method-name">set</span><span class="method-args">(key, value)</span>
|
291
|
+
</a>
|
292
|
+
</div>
|
293
|
+
|
294
|
+
<div class="method-description">
|
295
|
+
<p>
|
296
|
+
Saves a variable <tt>key</tt> as the string <tt>value</tt> in the global
|
297
|
+
namespace.
|
298
|
+
</p>
|
299
|
+
</div>
|
300
|
+
</div>
|
301
|
+
|
302
|
+
<div id="method-M000010" class="method-detail">
|
303
|
+
<a name="M000010"></a>
|
304
|
+
|
305
|
+
<div class="method-heading">
|
306
|
+
<a href="NamespaceItem.src/M000010.html" target="Code" class="method-signature"
|
307
|
+
onclick="popupCode('NamespaceItem.src/M000010.html');return false;">
|
308
|
+
<span class="method-name">true?</span><span class="method-args">(flag)</span>
|
309
|
+
</a>
|
310
|
+
</div>
|
311
|
+
|
312
|
+
<div class="method-description">
|
313
|
+
<p>
|
314
|
+
A convenience method to test whether a variable has a true value. Returns
|
315
|
+
nil if <tt>flag</tt> is not found in the namespace, or <tt>flag</tt> has a
|
316
|
+
nil value attached to it.
|
317
|
+
</p>
|
318
|
+
</div>
|
319
|
+
</div>
|
320
|
+
|
321
|
+
|
322
|
+
</div>
|
323
|
+
|
324
|
+
|
325
|
+
</div>
|
326
|
+
|
327
|
+
|
328
|
+
<div id="validator-badges">
|
329
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
330
|
+
</div>
|
331
|
+
|
332
|
+
</body>
|
333
|
+
</html>
|