wee 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/TODO +31 -0
- data/benchmark.rb +37 -0
- data/demo.ru +11 -0
- data/doc/rdoc/classes/Array.html +22 -26
- data/doc/rdoc/classes/Hash.html +22 -26
- data/doc/rdoc/classes/Object.html +21 -26
- data/doc/rdoc/classes/String.html +19 -87
- data/doc/rdoc/classes/Struct.html +22 -26
- data/doc/rdoc/classes/Wee.html +75 -206
- data/doc/rdoc/classes/Wee/AnswerDecoration.html +35 -66
- data/doc/rdoc/classes/Wee/AnswerDecoration/Answer.html +28 -46
- data/doc/rdoc/classes/Wee/Application.html +63 -114
- data/doc/rdoc/classes/Wee/Application/SessionCache.html +30 -44
- data/doc/rdoc/classes/Wee/Brush.html +52 -101
- data/doc/rdoc/classes/Wee/Brush/ActionInputTag.html +29 -51
- data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +44 -101
- data/doc/rdoc/classes/Wee/Brush/CheckboxTag.html +43 -76
- data/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +29 -46
- data/doc/rdoc/classes/Wee/Brush/FormTag.html +48 -110
- data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +30 -42
- data/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html +37 -58
- data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +93 -210
- data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +38 -63
- data/doc/rdoc/classes/Wee/Brush/HiddenInputTag.html +29 -45
- data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +35 -52
- data/doc/rdoc/classes/Wee/Brush/ImageTag.html +28 -61
- data/doc/rdoc/classes/Wee/Brush/InputTag.html +34 -107
- data/doc/rdoc/classes/Wee/Brush/JavascriptTag.html +28 -54
- data/doc/rdoc/classes/Wee/Brush/Page.html +39 -73
- data/doc/rdoc/classes/Wee/Brush/PasswordInputTag.html +29 -45
- data/doc/rdoc/classes/Wee/Brush/RadioButtonTag.html +54 -98
- data/doc/rdoc/classes/Wee/Brush/RadioGroup.html +46 -84
- data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +87 -187
- data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +29 -56
- data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +29 -45
- data/doc/rdoc/classes/Wee/Brush/TableDataTag.html +28 -55
- data/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +28 -55
- data/doc/rdoc/classes/Wee/Brush/TableRowTag.html +56 -113
- data/doc/rdoc/classes/Wee/Brush/TableTag.html +27 -58
- data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +48 -140
- data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +29 -45
- data/doc/rdoc/classes/Wee/CallAnswerMixin.html +51 -79
- data/doc/rdoc/classes/Wee/CallbackMixin.html +44 -77
- data/doc/rdoc/classes/Wee/CallbackRegistry.html +69 -125
- data/doc/rdoc/classes/Wee/Callbacks.html +43 -82
- data/doc/rdoc/classes/Wee/Component.html +142 -292
- data/doc/rdoc/classes/Wee/Decoration.html +85 -141
- data/doc/rdoc/classes/Wee/DecorationMixin.html +111 -118
- data/doc/rdoc/classes/Wee/Delegate.html +72 -115
- data/doc/rdoc/classes/Wee/DupReplaceSnapshotMixin.html +37 -54
- data/doc/rdoc/classes/Wee/ErrorResponse.html +31 -48
- data/doc/rdoc/classes/Wee/FormDecoration.html +32 -46
- data/doc/rdoc/classes/Wee/GenericResponse.html +30 -50
- data/doc/rdoc/classes/Wee/HtmlCanvas.html +209 -562
- data/doc/rdoc/classes/Wee/HtmlDocument.html +51 -91
- data/doc/rdoc/classes/Wee/HtmlWriter.html +76 -156
- data/doc/rdoc/classes/Wee/IdGenerator.html +28 -44
- data/doc/rdoc/classes/Wee/IdGenerator/Secure.html +53 -95
- data/doc/rdoc/classes/Wee/IdGenerator/Sequential.html +37 -63
- data/doc/rdoc/classes/Wee/JQuery.html +36 -64
- data/doc/rdoc/classes/Wee/LRUCache.html +94 -189
- data/doc/rdoc/classes/Wee/LRUCache/Item.html +30 -42
- data/doc/rdoc/classes/Wee/ObjectSnapshotMixin.html +37 -54
- data/doc/rdoc/classes/Wee/PageDecoration.html +48 -79
- data/doc/rdoc/classes/Wee/Presenter.html +86 -143
- data/doc/rdoc/classes/Wee/RedirectResponse.html +31 -49
- data/doc/rdoc/classes/Wee/RefreshResponse.html +34 -48
- data/doc/rdoc/classes/Wee/Renderer.html +56 -125
- data/doc/rdoc/classes/Wee/Request.html +57 -115
- data/doc/rdoc/classes/Wee/Response.html +24 -26
- data/doc/rdoc/classes/Wee/Session.html +137 -292
- data/doc/rdoc/classes/Wee/Session/AbortCallbackProcessing.html +29 -46
- data/doc/rdoc/classes/Wee/Session/MutexSerializer.html +29 -42
- data/doc/rdoc/classes/Wee/Session/Page.html +22 -21
- data/doc/rdoc/classes/Wee/Session/ThreadSerializer.html +36 -60
- data/doc/rdoc/classes/Wee/State.html +57 -105
- data/doc/rdoc/classes/Wee/State/Snapshot.html +22 -21
- data/doc/rdoc/classes/Wee/State/SnapshotIVars.html +22 -21
- data/doc/rdoc/classes/Wee/StructSnapshotMixin.html +37 -54
- data/doc/rdoc/classes/Wee/WrapperDecoration.html +42 -68
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README_rdoc.html +26 -17
- data/doc/rdoc/files/lib/wee/application_rb.html +25 -19
- data/doc/rdoc/files/lib/wee/call_answer_rb.html +23 -12
- data/doc/rdoc/files/lib/wee/callback_rb.html +23 -12
- data/doc/rdoc/files/lib/wee/component_rb.html +25 -19
- data/doc/rdoc/files/lib/wee/decoration_rb.html +23 -15
- data/doc/rdoc/files/lib/wee/html_brushes_rb.html +23 -12
- data/doc/rdoc/files/lib/wee/html_canvas_rb.html +23 -15
- data/doc/rdoc/files/lib/wee/html_document_rb.html +23 -15
- data/doc/rdoc/files/lib/wee/html_writer_rb.html +23 -15
- data/doc/rdoc/files/lib/wee/id_generator_rb.html +24 -17
- data/doc/rdoc/files/lib/wee/jquery/jquery_rb.html +23 -12
- data/doc/rdoc/files/lib/wee/jquery_rb.html +23 -15
- data/doc/rdoc/files/lib/wee/lru_cache_rb.html +23 -12
- data/doc/rdoc/files/lib/wee/presenter_rb.html +23 -12
- data/doc/rdoc/files/lib/wee/renderer_rb.html +23 -12
- data/doc/rdoc/files/lib/wee/request_rb.html +23 -15
- data/doc/rdoc/files/lib/wee/response_rb.html +24 -17
- data/doc/rdoc/files/lib/wee/session_rb.html +26 -21
- data/doc/rdoc/files/lib/wee/state_rb.html +23 -12
- data/doc/rdoc/files/lib/wee_rb.html +37 -47
- data/doc/rdoc/fr_class_index.html +12 -86
- data/doc/rdoc/fr_file_index.html +12 -30
- data/doc/rdoc/fr_method_index.html +242 -473
- data/doc/rdoc/index.html +8 -5
- data/doc/rdoc/rdoc-style.css +119 -210
- data/examples/ObjectSpaceBrowser.rb +4 -4
- data/examples/TODO +21 -0
- data/examples/ajax.rb +6 -4
- data/examples/blog.rb +42 -0
- data/examples/demo.rb +5 -3
- data/examples/demo/calculator.rb +3 -3
- data/examples/demo/calendar.rb +4 -4
- data/examples/demo/counter.rb +2 -2
- data/examples/demo/editable_counter.rb +2 -2
- data/examples/demo/example.rb +25 -16
- data/examples/demo/window.rb +10 -3
- data/examples/hw2.rb +17 -0
- data/examples/recipe/description.rb +170 -0
- data/examples/recipe/migrations/001_create_recipes.rb +13 -0
- data/examples/recipe/model.rb +27 -0
- data/examples/recipe/models/recipe.rb +18 -0
- data/examples/recipe/recipe_editor.rb +28 -0
- data/lib/wee.rb +1 -7
- data/lib/wee/component.rb +37 -74
- data/lib/wee/decoration.rb +16 -15
- data/lib/wee/html_brushes.rb +16 -17
- data/lib/wee/presenter.rb +2 -1
- data/lib/wee/response.rb +4 -4
- data/lib/wee/session.rb +2 -2
- data/lib/wee/state.rb +2 -2
- data/test/t.rb +67 -0
- data/wee.gemspec +1 -1
- metadata +157 -167
@@ -1,9 +1,12 @@
|
|
1
|
-
|
2
|
-
|
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
|
+
|
3
6
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
7
|
<head>
|
5
|
-
<title>Class: Wee::Decoration
|
6
|
-
<meta http-equiv="Content-Type" content="text/html; charset=
|
8
|
+
<title>Class: Wee::Decoration</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
7
10
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
8
11
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
9
12
|
<script type="text/javascript">
|
@@ -22,7 +25,7 @@
|
|
22
25
|
return false;
|
23
26
|
|
24
27
|
elemStyle = elem.style;
|
25
|
-
|
28
|
+
|
26
29
|
if ( elemStyle.display != "block" ) {
|
27
30
|
elemStyle.display = "block"
|
28
31
|
} else {
|
@@ -31,10 +34,10 @@
|
|
31
34
|
|
32
35
|
return true;
|
33
36
|
}
|
34
|
-
|
37
|
+
|
35
38
|
// Make codeblocks hidden by default
|
36
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }
|
37
|
-
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
38
41
|
// ]]>
|
39
42
|
</script>
|
40
43
|
|
@@ -42,6 +45,7 @@
|
|
42
45
|
<body>
|
43
46
|
|
44
47
|
|
48
|
+
|
45
49
|
<div id="classHeader">
|
46
50
|
<table class="header-table">
|
47
51
|
<tr class="top-aligned-row">
|
@@ -51,48 +55,37 @@
|
|
51
55
|
<tr class="top-aligned-row">
|
52
56
|
<td><strong>In:</strong></td>
|
53
57
|
<td>
|
54
|
-
|
55
|
-
|
56
58
|
<a href="../../files/lib/wee/decoration_rb.html">
|
57
|
-
|
58
59
|
lib/wee/decoration.rb
|
59
|
-
|
60
60
|
</a>
|
61
|
-
|
62
|
-
|
63
61
|
<br />
|
64
|
-
|
65
62
|
</td>
|
66
63
|
</tr>
|
67
64
|
|
68
|
-
|
69
65
|
<tr class="top-aligned-row">
|
70
66
|
<td><strong>Parent:</strong></td>
|
71
67
|
<td>
|
72
|
-
|
73
68
|
<a href="Presenter.html">
|
74
|
-
|
75
|
-
Wee::Presenter
|
76
|
-
|
69
|
+
Presenter
|
77
70
|
</a>
|
78
|
-
|
79
71
|
</td>
|
80
72
|
</tr>
|
81
|
-
|
82
73
|
</table>
|
83
74
|
</div>
|
84
75
|
<!-- banner header -->
|
85
76
|
|
86
77
|
<div id="bodyContent">
|
87
78
|
|
79
|
+
|
80
|
+
|
88
81
|
<div id="contextContent">
|
89
82
|
|
90
83
|
<div id="description">
|
91
84
|
<p>
|
92
85
|
Abstract base class of all decorations. Forwards the methods <a
|
93
|
-
href="Decoration.html#
|
94
|
-
href="Decoration.html#
|
95
|
-
href="Decoration.html#
|
86
|
+
href="Decoration.html#M000108">process_callbacks</a>, <a
|
87
|
+
href="Decoration.html#M000109">render_on</a> and <a
|
88
|
+
href="Decoration.html#M000110">state</a> to the next decoration in the
|
96
89
|
chain. Subclasses should provide special behaviour in these methods,
|
97
90
|
otherwise the decoration does not make sense.
|
98
91
|
</p>
|
@@ -113,121 +106,80 @@ around the decorations or components below itself:
|
|
113
106
|
|
114
107
|
</div>
|
115
108
|
|
116
|
-
</div>
|
117
109
|
|
110
|
+
</div>
|
118
111
|
|
119
112
|
<div id="method-list">
|
120
113
|
<h3 class="section-bar">Methods</h3>
|
121
114
|
|
122
115
|
<div class="name-list">
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
<a href="#M000194">process_callbacks</a>
|
129
|
-
|
130
|
-
<a href="#M000195">render_on</a>
|
131
|
-
|
132
|
-
<a href="#M000196">render_presenter_on</a>
|
133
|
-
|
116
|
+
<a href="#M000107">global?</a>
|
117
|
+
<a href="#M000108">process_callbacks</a>
|
118
|
+
<a href="#M000109">render_on</a>
|
119
|
+
<a href="#M000110">state</a>
|
134
120
|
</div>
|
135
121
|
</div>
|
136
122
|
|
137
123
|
</div>
|
138
124
|
|
125
|
+
|
139
126
|
<!-- if includes -->
|
140
127
|
|
141
128
|
<div id="section">
|
142
129
|
|
143
130
|
|
144
131
|
|
132
|
+
<div id="aliases-list">
|
133
|
+
<h3 class="section-bar">External Aliases</h3>
|
134
|
+
|
135
|
+
<div class="name-list">
|
136
|
+
<table summary="aliases">
|
137
|
+
<tr class="top-aligned-row context-row">
|
138
|
+
<td class="context-item-name">render_on</td>
|
139
|
+
<td>-></td>
|
140
|
+
<td class="context-item-value">render_presenter_on</td>
|
141
|
+
</tr>
|
142
|
+
</table>
|
143
|
+
</div>
|
144
|
+
</div>
|
145
|
+
|
146
|
+
|
145
147
|
<div id="attribute-list">
|
146
148
|
<h3 class="section-bar">Attributes</h3>
|
147
149
|
|
148
150
|
<div class="name-list">
|
149
151
|
<table>
|
150
|
-
|
151
152
|
<tr class="top-aligned-row context-row">
|
152
153
|
<td class="context-item-name">next</td>
|
153
|
-
|
154
154
|
<td class="context-item-value"> [RW] </td>
|
155
|
-
|
156
155
|
<td class="context-item-desc">
|
157
156
|
Points to the next decoration in the chain. A decoration is responsible for
|
158
|
-
all decorations or components
|
159
|
-
|
160
|
-
|
157
|
+
all decorations or components "below" it (everything that follows
|
158
|
+
this decoration in the chain). In other words, it‘s the owner of
|
159
|
+
everything "below" itself.
|
161
160
|
|
162
161
|
</td>
|
163
162
|
</tr>
|
164
|
-
|
165
163
|
</table>
|
166
164
|
</div>
|
167
165
|
</div>
|
166
|
+
|
168
167
|
|
169
168
|
|
170
169
|
<!-- if method_list -->
|
171
|
-
|
172
170
|
<div id="methods">
|
173
|
-
|
174
171
|
<h3 class="section-bar">Public Instance methods</h3>
|
175
172
|
|
176
|
-
|
177
|
-
|
178
|
-
<a name="M000197"></a>
|
179
|
-
|
180
|
-
<div class="method-heading">
|
181
|
-
|
182
|
-
<a href="#M000197" class="method-signature">
|
183
|
-
|
184
|
-
<span class="method-name">backtrack</span><span class="method-args">(state)</span>
|
185
|
-
|
186
|
-
</a>
|
187
|
-
|
188
|
-
</div>
|
189
|
-
|
190
|
-
<div class="method-description">
|
191
|
-
|
192
|
-
<p>
|
193
|
-
We have to save the @next attribute to be able to correctly backtrack
|
194
|
-
calls, as method Wee::Component#call modifies it in the call to
|
195
|
-
<tt>component.remove_decoration(answer)</tt>. Removing the
|
196
|
-
answer-decoration has the advantage to be able to call a component more
|
197
|
-
than once!
|
198
|
-
</p>
|
199
|
-
|
200
|
-
<p><a class="source-toggle" href="#"
|
201
|
-
onclick="toggleCode('M000197-source');return false;">[Source]</a></p>
|
202
|
-
<div class="method-source-code" id="M000197-source">
|
203
|
-
<pre>
|
204
|
-
<span class="ruby-comment cmt"># File lib/wee/decoration.rb, line 65</span>
|
205
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">backtrack</span>(<span class="ruby-identifier">state</span>)
|
206
|
-
<span class="ruby-ivar">@next</span>.<span class="ruby-identifier">backtrack</span>(<span class="ruby-identifier">state</span>)
|
207
|
-
<span class="ruby-identifier">state</span>.<span class="ruby-identifier">add_ivar</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">:@next</span>, <span class="ruby-ivar">@next</span>)
|
208
|
-
<span class="ruby-keyword kw">end</span>
|
209
|
-
</pre>
|
210
|
-
</div>
|
211
|
-
|
212
|
-
</div>
|
213
|
-
</div>
|
214
|
-
|
215
|
-
|
216
|
-
<div id="method-M000193" class="method-detail">
|
217
|
-
<a name="M000193"></a>
|
173
|
+
<div id="method-M000107" class="method-detail">
|
174
|
+
<a name="M000107"></a>
|
218
175
|
|
219
176
|
<div class="method-heading">
|
220
|
-
|
221
|
-
<a href="#M000193" class="method-signature">
|
222
|
-
|
177
|
+
<a href="#M000107" class="method-signature">
|
223
178
|
<span class="method-name">global?</span><span class="method-args">()</span>
|
224
|
-
|
225
179
|
</a>
|
226
|
-
|
227
180
|
</div>
|
228
|
-
|
181
|
+
|
229
182
|
<div class="method-description">
|
230
|
-
|
231
183
|
<p>
|
232
184
|
Is this decoration a global or a local one? By default all decorations are
|
233
185
|
local unless this method is overwritten.
|
@@ -237,42 +189,33 @@ A global decoration is added in front of the decoration chain, a local
|
|
237
189
|
decoration is added in front of all other local decorations but after all
|
238
190
|
global decorations.
|
239
191
|
</p>
|
240
|
-
|
241
192
|
<p><a class="source-toggle" href="#"
|
242
|
-
onclick="toggleCode('
|
243
|
-
<div class="method-source-code" id="
|
193
|
+
onclick="toggleCode('M000107-source');return false;">[Source]</a></p>
|
194
|
+
<div class="method-source-code" id="M000107-source">
|
244
195
|
<pre>
|
245
196
|
<span class="ruby-comment cmt"># File lib/wee/decoration.rb, line 41</span>
|
246
197
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">global?</span>() <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">end</span>
|
247
198
|
</pre>
|
248
199
|
</div>
|
249
|
-
|
250
200
|
</div>
|
251
201
|
</div>
|
252
202
|
|
253
|
-
|
254
|
-
|
255
|
-
<a name="M000194"></a>
|
203
|
+
<div id="method-M000108" class="method-detail">
|
204
|
+
<a name="M000108"></a>
|
256
205
|
|
257
206
|
<div class="method-heading">
|
258
|
-
|
259
|
-
<a href="#M000194" class="method-signature">
|
260
|
-
|
207
|
+
<a href="#M000108" class="method-signature">
|
261
208
|
<span class="method-name">process_callbacks</span><span class="method-args">(callbacks)</span>
|
262
|
-
|
263
209
|
</a>
|
264
|
-
|
265
210
|
</div>
|
266
|
-
|
211
|
+
|
267
212
|
<div class="method-description">
|
268
|
-
|
269
213
|
<p>
|
270
214
|
Forwards method call to the next decoration in the chain.
|
271
215
|
</p>
|
272
|
-
|
273
216
|
<p><a class="source-toggle" href="#"
|
274
|
-
onclick="toggleCode('
|
275
|
-
<div class="method-source-code" id="
|
217
|
+
onclick="toggleCode('M000108-source');return false;">[Source]</a></p>
|
218
|
+
<div class="method-source-code" id="M000108-source">
|
276
219
|
<pre>
|
277
220
|
<span class="ruby-comment cmt"># File lib/wee/decoration.rb, line 46</span>
|
278
221
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_callbacks</span>(<span class="ruby-identifier">callbacks</span>)
|
@@ -280,33 +223,25 @@ Forwards method call to the next decoration in the chain.
|
|
280
223
|
<span class="ruby-keyword kw">end</span>
|
281
224
|
</pre>
|
282
225
|
</div>
|
283
|
-
|
284
226
|
</div>
|
285
227
|
</div>
|
286
228
|
|
287
|
-
|
288
|
-
|
289
|
-
<a name="M000195"></a>
|
229
|
+
<div id="method-M000109" class="method-detail">
|
230
|
+
<a name="M000109"></a>
|
290
231
|
|
291
232
|
<div class="method-heading">
|
292
|
-
|
293
|
-
<a href="#M000195" class="method-signature">
|
294
|
-
|
233
|
+
<a href="#M000109" class="method-signature">
|
295
234
|
<span class="method-name">render_on</span><span class="method-args">(r)</span>
|
296
|
-
|
297
235
|
</a>
|
298
|
-
|
299
236
|
</div>
|
300
|
-
|
237
|
+
|
301
238
|
<div class="method-description">
|
302
|
-
|
303
239
|
<p>
|
304
240
|
Forwards method call to the next decoration in the chain.
|
305
241
|
</p>
|
306
|
-
|
307
242
|
<p><a class="source-toggle" href="#"
|
308
|
-
onclick="toggleCode('
|
309
|
-
<div class="method-source-code" id="
|
243
|
+
onclick="toggleCode('M000109-source');return false;">[Source]</a></p>
|
244
|
+
<div class="method-source-code" id="M000109-source">
|
310
245
|
<pre>
|
311
246
|
<span class="ruby-comment cmt"># File lib/wee/decoration.rb, line 54</span>
|
312
247
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render_on</span>(<span class="ruby-identifier">r</span>)
|
@@ -314,41 +249,50 @@ Forwards method call to the next decoration in the chain.
|
|
314
249
|
<span class="ruby-keyword kw">end</span>
|
315
250
|
</pre>
|
316
251
|
</div>
|
317
|
-
|
318
252
|
</div>
|
319
253
|
</div>
|
320
254
|
|
321
|
-
|
322
|
-
|
323
|
-
<a name="M000196"></a>
|
255
|
+
<div id="method-M000110" class="method-detail">
|
256
|
+
<a name="M000110"></a>
|
324
257
|
|
325
258
|
<div class="method-heading">
|
326
|
-
|
327
|
-
<span class="method-name">
|
328
|
-
|
259
|
+
<a href="#M000110" class="method-signature">
|
260
|
+
<span class="method-name">state</span><span class="method-args">(s)</span>
|
261
|
+
</a>
|
329
262
|
</div>
|
330
|
-
|
263
|
+
|
331
264
|
<div class="method-description">
|
332
|
-
|
333
265
|
<p>
|
334
|
-
|
266
|
+
We have to save the @next attribute to be able to correctly backtrack
|
267
|
+
calls, as method Wee::Component#call modifies it in the call to
|
268
|
+
<tt>component.remove_decoration(answer)</tt>. Removing the
|
269
|
+
answer-decoration has the advantage to be able to call a component more
|
270
|
+
than once!
|
335
271
|
</p>
|
336
|
-
|
272
|
+
<p><a class="source-toggle" href="#"
|
273
|
+
onclick="toggleCode('M000110-source');return false;">[Source]</a></p>
|
274
|
+
<div class="method-source-code" id="M000110-source">
|
275
|
+
<pre>
|
276
|
+
<span class="ruby-comment cmt"># File lib/wee/decoration.rb, line 65</span>
|
277
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">state</span>(<span class="ruby-identifier">s</span>)
|
278
|
+
<span class="ruby-ivar">@next</span>.<span class="ruby-identifier">state</span>(<span class="ruby-identifier">s</span>)
|
279
|
+
<span class="ruby-identifier">s</span>.<span class="ruby-identifier">add_ivar</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">:@next</span>, <span class="ruby-ivar">@next</span>)
|
280
|
+
<span class="ruby-keyword kw">end</span>
|
281
|
+
</pre>
|
282
|
+
</div>
|
337
283
|
</div>
|
338
284
|
</div>
|
339
285
|
|
340
286
|
|
341
|
-
|
342
287
|
</div>
|
343
288
|
|
344
289
|
|
345
|
-
|
346
|
-
|
347
290
|
</div>
|
348
291
|
|
292
|
+
|
349
293
|
<div id="validator-badges">
|
350
294
|
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
351
295
|
</div>
|
352
296
|
|
353
297
|
</body>
|
354
|
-
</html>
|
298
|
+
</html>
|
@@ -1,9 +1,12 @@
|
|
1
|
-
|
2
|
-
|
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
|
+
|
3
6
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
7
|
<head>
|
5
|
-
<title>Module: Wee::DecorationMixin
|
6
|
-
<meta http-equiv="Content-Type" content="text/html; charset=
|
8
|
+
<title>Module: Wee::DecorationMixin</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
7
10
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
8
11
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
9
12
|
<script type="text/javascript">
|
@@ -22,7 +25,7 @@
|
|
22
25
|
return false;
|
23
26
|
|
24
27
|
elemStyle = elem.style;
|
25
|
-
|
28
|
+
|
26
29
|
if ( elemStyle.display != "block" ) {
|
27
30
|
elemStyle.display = "block"
|
28
31
|
} else {
|
@@ -31,10 +34,10 @@
|
|
31
34
|
|
32
35
|
return true;
|
33
36
|
}
|
34
|
-
|
37
|
+
|
35
38
|
// Make codeblocks hidden by default
|
36
|
-
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }
|
37
|
-
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
38
41
|
// ]]>
|
39
42
|
</script>
|
40
43
|
|
@@ -42,6 +45,7 @@
|
|
42
45
|
<body>
|
43
46
|
|
44
47
|
|
48
|
+
|
45
49
|
<div id="classHeader">
|
46
50
|
<table class="header-table">
|
47
51
|
<tr class="top-aligned-row">
|
@@ -51,118 +55,90 @@
|
|
51
55
|
<tr class="top-aligned-row">
|
52
56
|
<td><strong>In:</strong></td>
|
53
57
|
<td>
|
54
|
-
|
55
|
-
|
56
58
|
<a href="../../files/lib/wee/decoration_rb.html">
|
57
|
-
|
58
59
|
lib/wee/decoration.rb
|
59
|
-
|
60
60
|
</a>
|
61
|
-
|
62
|
-
|
63
61
|
<br />
|
64
|
-
|
65
62
|
</td>
|
66
63
|
</tr>
|
67
64
|
|
68
|
-
|
69
65
|
</table>
|
70
66
|
</div>
|
71
67
|
<!-- banner header -->
|
72
68
|
|
73
69
|
<div id="bodyContent">
|
74
70
|
|
71
|
+
|
72
|
+
|
75
73
|
<div id="contextContent">
|
76
74
|
|
77
|
-
</div>
|
78
75
|
|
79
76
|
|
77
|
+
</div>
|
78
|
+
|
80
79
|
<div id="method-list">
|
81
80
|
<h3 class="section-bar">Methods</h3>
|
82
81
|
|
83
82
|
<div class="name-list">
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
<a href="#M000013">remove_decoration_if</a>
|
92
|
-
|
83
|
+
<a href="#M000016">add_decoration</a>
|
84
|
+
<a href="#M000014">decoration</a>
|
85
|
+
<a href="#M000013">decoration=</a>
|
86
|
+
<a href="#M000015">each_decoration</a>
|
87
|
+
<a href="#M000017">remove_decoration</a>
|
88
|
+
<a href="#M000018">remove_decoration_if</a>
|
93
89
|
</div>
|
94
90
|
</div>
|
95
91
|
|
96
92
|
</div>
|
97
93
|
|
94
|
+
|
98
95
|
<!-- if includes -->
|
99
96
|
|
100
97
|
<div id="section">
|
101
98
|
|
102
99
|
|
103
100
|
|
104
|
-
<div id="attribute-list">
|
105
|
-
<h3 class="section-bar">Attributes</h3>
|
106
101
|
|
107
|
-
<div class="name-list">
|
108
|
-
<table>
|
109
102
|
|
110
|
-
|
111
|
-
<td class="context-item-name">decoration</td>
|
112
|
-
|
113
|
-
<td class="context-item-value"> [RW] </td>
|
114
|
-
|
115
|
-
<td class="context-item-desc"></td>
|
116
|
-
</tr>
|
117
|
-
|
118
|
-
</table>
|
119
|
-
</div>
|
120
|
-
</div>
|
103
|
+
|
121
104
|
|
122
105
|
|
123
106
|
<!-- if method_list -->
|
124
|
-
|
125
107
|
<div id="methods">
|
126
|
-
|
127
108
|
<h3 class="section-bar">Public Instance methods</h3>
|
128
109
|
|
129
|
-
|
130
|
-
|
131
|
-
<a name="M000011"></a>
|
110
|
+
<div id="method-M000016" class="method-detail">
|
111
|
+
<a name="M000016"></a>
|
132
112
|
|
133
113
|
<div class="method-heading">
|
134
|
-
|
135
|
-
<a href="#M000011" class="method-signature">
|
136
|
-
|
114
|
+
<a href="#M000016" class="method-signature">
|
137
115
|
<span class="method-name">add_decoration</span><span class="method-args">(d)</span>
|
138
|
-
|
139
116
|
</a>
|
140
|
-
|
141
117
|
</div>
|
142
|
-
|
118
|
+
|
143
119
|
<div class="method-description">
|
144
|
-
|
145
120
|
<p>
|
146
|
-
Adds decoration <tt>d</tt> to
|
121
|
+
Adds <a href="DecorationMixin.html#M000014">decoration</a> <tt>d</tt> to
|
122
|
+
the <a href="DecorationMixin.html#M000014">decoration</a> chain.
|
147
123
|
</p>
|
148
124
|
<p>
|
149
|
-
A global decoration is added in
|
150
|
-
|
151
|
-
|
125
|
+
A global <a href="DecorationMixin.html#M000014">decoration</a> is added in
|
126
|
+
front of the <a href="DecorationMixin.html#M000014">decoration</a> chain, a
|
127
|
+
local <a href="DecorationMixin.html#M000014">decoration</a> is added in
|
128
|
+
front of all other local decorations but after all global decorations.
|
152
129
|
</p>
|
153
130
|
<p>
|
154
131
|
Returns: <tt>self</tt>
|
155
132
|
</p>
|
156
|
-
|
157
133
|
<p><a class="source-toggle" href="#"
|
158
|
-
onclick="toggleCode('
|
159
|
-
<div class="method-source-code" id="
|
134
|
+
onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
|
135
|
+
<div class="method-source-code" id="M000016-source">
|
160
136
|
<pre>
|
161
|
-
<span class="ruby-comment cmt"># File lib/wee/decoration.rb, line
|
137
|
+
<span class="ruby-comment cmt"># File lib/wee/decoration.rb, line 97</span>
|
162
138
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_decoration</span>(<span class="ruby-identifier">d</span>)
|
163
139
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">d</span>.<span class="ruby-identifier">global?</span>
|
164
|
-
<span class="ruby-identifier">d</span>.<span class="ruby-identifier">next</span> = <span class="ruby-
|
165
|
-
<span class="ruby-
|
140
|
+
<span class="ruby-identifier">d</span>.<span class="ruby-identifier">next</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decoration</span>
|
141
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decoration</span> = <span class="ruby-identifier">d</span>
|
166
142
|
<span class="ruby-keyword kw">else</span>
|
167
143
|
<span class="ruby-identifier">last_global</span> = <span class="ruby-keyword kw">nil</span>
|
168
144
|
<span class="ruby-identifier">each_decoration</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
@@ -174,8 +150,8 @@ Returns: <tt>self</tt>
|
|
174
150
|
}
|
175
151
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">last_global</span>.<span class="ruby-identifier">nil?</span>
|
176
152
|
<span class="ruby-comment cmt"># no global decorations specified -> add in front</span>
|
177
|
-
<span class="ruby-identifier">d</span>.<span class="ruby-identifier">next</span> = <span class="ruby-
|
178
|
-
<span class="ruby-
|
153
|
+
<span class="ruby-identifier">d</span>.<span class="ruby-identifier">next</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decoration</span>
|
154
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decoration</span> = <span class="ruby-identifier">d</span>
|
179
155
|
<span class="ruby-keyword kw">else</span>
|
180
156
|
<span class="ruby-comment cmt"># add after last_global</span>
|
181
157
|
<span class="ruby-identifier">d</span>.<span class="ruby-identifier">next</span> = <span class="ruby-identifier">last_global</span>.<span class="ruby-identifier">next</span>
|
@@ -187,35 +163,69 @@ Returns: <tt>self</tt>
|
|
187
163
|
<span class="ruby-keyword kw">end</span>
|
188
164
|
</pre>
|
189
165
|
</div>
|
190
|
-
|
191
166
|
</div>
|
192
167
|
</div>
|
193
168
|
|
169
|
+
<div id="method-M000014" class="method-detail">
|
170
|
+
<a name="M000014"></a>
|
171
|
+
|
172
|
+
<div class="method-heading">
|
173
|
+
<a href="#M000014" class="method-signature">
|
174
|
+
<span class="method-name">decoration</span><span class="method-args">()</span>
|
175
|
+
</a>
|
176
|
+
</div>
|
177
|
+
|
178
|
+
<div class="method-description">
|
179
|
+
<p><a class="source-toggle" href="#"
|
180
|
+
onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
|
181
|
+
<div class="method-source-code" id="M000014-source">
|
182
|
+
<pre>
|
183
|
+
<span class="ruby-comment cmt"># File lib/wee/decoration.rb, line 75</span>
|
184
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">decoration</span>() <span class="ruby-ivar">@decoration</span> <span class="ruby-operator">||</span> <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">end</span>
|
185
|
+
</pre>
|
186
|
+
</div>
|
187
|
+
</div>
|
188
|
+
</div>
|
194
189
|
|
195
|
-
<div id="method-
|
196
|
-
<a name="
|
190
|
+
<div id="method-M000013" class="method-detail">
|
191
|
+
<a name="M000013"></a>
|
197
192
|
|
198
193
|
<div class="method-heading">
|
194
|
+
<a href="#M000013" class="method-signature">
|
195
|
+
<span class="method-name">decoration=</span><span class="method-args">(d)</span>
|
196
|
+
</a>
|
197
|
+
</div>
|
198
|
+
|
199
|
+
<div class="method-description">
|
200
|
+
<p><a class="source-toggle" href="#"
|
201
|
+
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
202
|
+
<div class="method-source-code" id="M000013-source">
|
203
|
+
<pre>
|
204
|
+
<span class="ruby-comment cmt"># File lib/wee/decoration.rb, line 74</span>
|
205
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">decoration=</span>(<span class="ruby-identifier">d</span>) <span class="ruby-ivar">@decoration</span> = <span class="ruby-identifier">d</span> <span class="ruby-keyword kw">end</span>
|
206
|
+
</pre>
|
207
|
+
</div>
|
208
|
+
</div>
|
209
|
+
</div>
|
199
210
|
|
200
|
-
|
211
|
+
<div id="method-M000015" class="method-detail">
|
212
|
+
<a name="M000015"></a>
|
201
213
|
|
214
|
+
<div class="method-heading">
|
215
|
+
<a href="#M000015" class="method-signature">
|
202
216
|
<span class="method-name">each_decoration</span><span class="method-args">( {|decoration| ...}</span>
|
203
|
-
|
204
217
|
</a>
|
205
|
-
|
206
218
|
</div>
|
207
|
-
|
219
|
+
|
208
220
|
<div class="method-description">
|
209
|
-
|
210
221
|
<p>
|
211
222
|
Iterates over all decorations (note that the component itself is excluded).
|
212
223
|
</p>
|
213
|
-
|
214
224
|
<p><a class="source-toggle" href="#"
|
215
|
-
onclick="toggleCode('
|
216
|
-
<div class="method-source-code" id="
|
225
|
+
onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
|
226
|
+
<div class="method-source-code" id="M000015-source">
|
217
227
|
<pre>
|
218
|
-
<span class="ruby-comment cmt"># File lib/wee/decoration.rb, line
|
228
|
+
<span class="ruby-comment cmt"># File lib/wee/decoration.rb, line 80</span>
|
219
229
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">each_decoration</span> <span class="ruby-comment cmt"># :yields: decoration</span>
|
220
230
|
<span class="ruby-identifier">d</span> = <span class="ruby-ivar">@decoration</span>
|
221
231
|
<span class="ruby-keyword kw">while</span> <span class="ruby-identifier">d</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">d</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">self</span>
|
@@ -225,44 +235,38 @@ Iterates over all decorations (note that the component itself is excluded).
|
|
225
235
|
<span class="ruby-keyword kw">end</span>
|
226
236
|
</pre>
|
227
237
|
</div>
|
228
|
-
|
229
238
|
</div>
|
230
239
|
</div>
|
231
240
|
|
232
|
-
|
233
|
-
|
234
|
-
<a name="M000012"></a>
|
241
|
+
<div id="method-M000017" class="method-detail">
|
242
|
+
<a name="M000017"></a>
|
235
243
|
|
236
244
|
<div class="method-heading">
|
237
|
-
|
238
|
-
<a href="#M000012" class="method-signature">
|
239
|
-
|
245
|
+
<a href="#M000017" class="method-signature">
|
240
246
|
<span class="method-name">remove_decoration</span><span class="method-args">(d)</span>
|
241
|
-
|
242
247
|
</a>
|
243
|
-
|
244
248
|
</div>
|
245
|
-
|
249
|
+
|
246
250
|
<div class="method-description">
|
247
|
-
|
248
251
|
<p>
|
249
|
-
Remove decoration <tt>d</tt>
|
252
|
+
Remove <a href="DecorationMixin.html#M000014">decoration</a> <tt>d</tt>
|
253
|
+
from the <a href="DecorationMixin.html#M000014">decoration</a> chain.
|
250
254
|
</p>
|
251
255
|
<p>
|
252
|
-
Returns the removed
|
253
|
-
|
256
|
+
Returns the removed <a href="DecorationMixin.html#M000014">decoration</a>
|
257
|
+
or <tt>nil</tt> if it did not exist in the <a
|
258
|
+
href="DecorationMixin.html#M000014">decoration</a> chain.
|
254
259
|
</p>
|
255
|
-
|
256
260
|
<p><a class="source-toggle" href="#"
|
257
|
-
onclick="toggleCode('
|
258
|
-
<div class="method-source-code" id="
|
261
|
+
onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
|
262
|
+
<div class="method-source-code" id="M000017-source">
|
259
263
|
<pre>
|
260
|
-
<span class="ruby-comment cmt"># File lib/wee/decoration.rb, line
|
264
|
+
<span class="ruby-comment cmt"># File lib/wee/decoration.rb, line 130</span>
|
261
265
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_decoration</span>(<span class="ruby-identifier">d</span>)
|
262
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">d</span> <span class="ruby-operator">==</span> <span class="ruby-
|
263
|
-
<span class="ruby-
|
266
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">d</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decoration</span> <span class="ruby-comment cmt"># 'd' is in front</span>
|
267
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decoration</span> = <span class="ruby-identifier">d</span>.<span class="ruby-identifier">next</span>
|
264
268
|
<span class="ruby-keyword kw">else</span>
|
265
|
-
<span class="ruby-identifier">last_decoration</span> = <span class="ruby-
|
269
|
+
<span class="ruby-identifier">last_decoration</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">decoration</span>
|
266
270
|
<span class="ruby-identifier">next_decoration</span> = <span class="ruby-keyword kw">nil</span>
|
267
271
|
<span class="ruby-identifier">loop</span> <span class="ruby-keyword kw">do</span>
|
268
272
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">last_decoration</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">last_decoration</span>.<span class="ruby-identifier">nil?</span>
|
@@ -277,26 +281,19 @@ decoration chain.
|
|
277
281
|
<span class="ruby-keyword kw">end</span>
|
278
282
|
</pre>
|
279
283
|
</div>
|
280
|
-
|
281
284
|
</div>
|
282
285
|
</div>
|
283
286
|
|
284
|
-
|
285
|
-
|
286
|
-
<a name="M000013"></a>
|
287
|
+
<div id="method-M000018" class="method-detail">
|
288
|
+
<a name="M000018"></a>
|
287
289
|
|
288
290
|
<div class="method-heading">
|
289
|
-
|
290
|
-
<a href="#M000013" class="method-signature">
|
291
|
-
|
291
|
+
<a href="#M000018" class="method-signature">
|
292
292
|
<span class="method-name">remove_decoration_if</span><span class="method-args">( {|decoration| ...}</span>
|
293
|
-
|
294
293
|
</a>
|
295
|
-
|
296
294
|
</div>
|
297
|
-
|
295
|
+
|
298
296
|
<div class="method-description">
|
299
|
-
|
300
297
|
<p>
|
301
298
|
Remove all decorations that match the block condition.
|
302
299
|
</p>
|
@@ -306,12 +303,11 @@ Example (removes all decorations of class <tt>HaloDecoration</tt>):
|
|
306
303
|
<pre>
|
307
304
|
remove_decoration_if {|d| d.class == HaloDecoration}
|
308
305
|
</pre>
|
309
|
-
|
310
306
|
<p><a class="source-toggle" href="#"
|
311
|
-
onclick="toggleCode('
|
312
|
-
<div class="method-source-code" id="
|
307
|
+
onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
|
308
|
+
<div class="method-source-code" id="M000018-source">
|
313
309
|
<pre>
|
314
|
-
<span class="ruby-comment cmt"># File lib/wee/decoration.rb, line
|
310
|
+
<span class="ruby-comment cmt"># File lib/wee/decoration.rb, line 155</span>
|
315
311
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_decoration_if</span> <span class="ruby-comment cmt"># :yields: decoration</span>
|
316
312
|
<span class="ruby-identifier">to_remove</span> = []
|
317
313
|
<span class="ruby-identifier">each_decoration</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span> <span class="ruby-identifier">to_remove</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">d</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">d</span>}
|
@@ -319,22 +315,19 @@ Example (removes all decorations of class <tt>HaloDecoration</tt>):
|
|
319
315
|
<span class="ruby-keyword kw">end</span>
|
320
316
|
</pre>
|
321
317
|
</div>
|
322
|
-
|
323
318
|
</div>
|
324
319
|
</div>
|
325
320
|
|
326
321
|
|
327
|
-
|
328
322
|
</div>
|
329
323
|
|
330
324
|
|
331
|
-
|
332
|
-
|
333
325
|
</div>
|
334
326
|
|
327
|
+
|
335
328
|
<div id="validator-badges">
|
336
329
|
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
337
330
|
</div>
|
338
331
|
|
339
332
|
</body>
|
340
|
-
</html>
|
333
|
+
</html>
|