wee 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (146) hide show
  1. data/ChangeLog +75 -0
  2. data/README +17 -9
  3. data/Rakefile +2 -2
  4. data/TODO +20 -0
  5. data/benchmark/Makefile +14 -9
  6. data/benchmark/counter.rb +11 -30
  7. data/benchmark/report_req.rb +12 -0
  8. data/doc/rdoc/classes/Array.html +12 -12
  9. data/doc/rdoc/classes/Cache/StorageCache.html +38 -38
  10. data/doc/rdoc/classes/Cache/Strategy/CapacityBounded.html +30 -30
  11. data/doc/rdoc/classes/Cache/Strategy/LFU.html +24 -24
  12. data/doc/rdoc/classes/Cache/Strategy/LRU.html +24 -24
  13. data/doc/rdoc/classes/Cache/Strategy/Unbounded.html +24 -24
  14. data/doc/rdoc/classes/Enumerable.html +6 -6
  15. data/doc/rdoc/classes/Object.html +12 -12
  16. data/doc/rdoc/classes/OgApplication.html +126 -0
  17. data/doc/rdoc/classes/OgScaffolder.html +401 -0
  18. data/doc/rdoc/classes/OgSession.html +172 -0
  19. data/doc/rdoc/classes/String.html +12 -12
  20. data/doc/rdoc/classes/Struct.html +12 -12
  21. data/doc/rdoc/classes/Wee.html +5 -62
  22. data/doc/rdoc/classes/Wee/AnswerDecoration.html +9 -9
  23. data/doc/rdoc/classes/Wee/Application.html +107 -39
  24. data/doc/rdoc/classes/Wee/Brush.html +22 -18
  25. data/doc/rdoc/classes/Wee/Brush/ActionCallbackMixin.html +17 -11
  26. data/doc/rdoc/classes/Wee/Brush/ActionURLCallbackMixin.html +18 -10
  27. data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +30 -64
  28. data/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +8 -10
  29. data/doc/rdoc/classes/Wee/Brush/FormTag.html +27 -79
  30. data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +12 -12
  31. data/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html +146 -0
  32. data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +179 -65
  33. data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +12 -12
  34. data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +16 -18
  35. data/doc/rdoc/classes/Wee/Brush/ImageTag.html +203 -0
  36. data/doc/rdoc/classes/Wee/Brush/InputCallbackMixin.html +17 -11
  37. data/doc/rdoc/classes/Wee/Brush/InputTag.html +15 -15
  38. data/doc/rdoc/classes/Wee/Brush/JavascriptTag.html +147 -0
  39. data/doc/rdoc/classes/Wee/Brush/Page.html +17 -17
  40. data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +25 -50
  41. data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +7 -38
  42. data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +7 -7
  43. data/doc/rdoc/classes/Wee/Brush/TableDataTag.html +15 -16
  44. data/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +7 -7
  45. data/doc/rdoc/classes/Wee/Brush/TableRowTag.html +65 -50
  46. data/doc/rdoc/classes/Wee/Brush/TableTag.html +7 -7
  47. data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +14 -64
  48. data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +7 -7
  49. data/doc/rdoc/classes/Wee/Brush/ToCallback.html +146 -0
  50. data/doc/rdoc/classes/Wee/CallbackRegistry.html +40 -40
  51. data/doc/rdoc/classes/Wee/CallbackStream.html +18 -18
  52. data/doc/rdoc/classes/Wee/Canvas.html +24 -24
  53. data/doc/rdoc/classes/Wee/Component.html +232 -149
  54. data/doc/rdoc/classes/Wee/Component/OnAnswer.html +153 -0
  55. data/doc/rdoc/classes/Wee/Decoration.html +42 -42
  56. data/doc/rdoc/classes/Wee/Delegate.html +27 -27
  57. data/doc/rdoc/classes/Wee/ErrorResponse.html +12 -12
  58. data/doc/rdoc/classes/Wee/FormDecoration.html +148 -0
  59. data/doc/rdoc/classes/Wee/GenericResponse.html +6 -6
  60. data/doc/rdoc/classes/Wee/HtmlCanvas.html +296 -215
  61. data/doc/rdoc/classes/Wee/HtmlWriter.html +83 -81
  62. data/doc/rdoc/classes/Wee/LiteralMethodCallback.html +21 -16
  63. data/doc/rdoc/classes/Wee/MessageBox.html +180 -0
  64. data/doc/rdoc/classes/Wee/PageDecoration.html +30 -30
  65. data/doc/rdoc/classes/Wee/Presenter.html +237 -69
  66. data/doc/rdoc/classes/Wee/RedirectResponse.html +6 -6
  67. data/doc/rdoc/classes/Wee/RefreshResponse.html +6 -6
  68. data/doc/rdoc/classes/Wee/Request.html +18 -18
  69. data/doc/rdoc/classes/Wee/RequestHandler.html +43 -39
  70. data/doc/rdoc/classes/Wee/Response.html +24 -24
  71. data/doc/rdoc/classes/Wee/Session.html +746 -72
  72. data/doc/rdoc/classes/Wee/SimpleIdGenerator.html +18 -18
  73. data/doc/rdoc/classes/Wee/Snapshot.html +19 -19
  74. data/doc/rdoc/classes/Wee/Utils.html +138 -2
  75. data/doc/rdoc/classes/Wee/Utils/LRUCache.html +7 -7
  76. data/doc/rdoc/classes/Wee/ValueHolder.html +18 -18
  77. data/doc/rdoc/classes/Wee/WEBrickAdaptor.html +43 -68
  78. data/doc/rdoc/classes/Wee/WrapperDecoration.html +150 -0
  79. data/doc/rdoc/created.rid +1 -1
  80. data/doc/rdoc/files/README.html +29 -15
  81. data/doc/rdoc/files/lib/wee/adaptors/webrick_rb.html +1 -1
  82. data/doc/rdoc/files/lib/wee/application_rb.html +1 -1
  83. data/doc/rdoc/files/lib/wee/components/form_decoration_rb.html +101 -0
  84. data/doc/rdoc/files/lib/wee/components/messagebox_rb.html +101 -0
  85. data/doc/rdoc/files/lib/wee/components/page_decoration_rb.html +1 -1
  86. data/doc/rdoc/files/lib/wee/components/wrapper_decoration_rb.html +101 -0
  87. data/doc/rdoc/files/lib/wee/components_rb.html +4 -1
  88. data/doc/rdoc/files/lib/wee/continuation/core/component_rb.html +101 -0
  89. data/doc/rdoc/files/lib/wee/continuation/session_rb.html +110 -0
  90. data/doc/rdoc/files/lib/wee/continuation_rb.html +116 -0
  91. data/doc/rdoc/files/lib/wee/core/callback_rb.html +1 -1
  92. data/doc/rdoc/files/lib/wee/core/component_rb.html +1 -1
  93. data/doc/rdoc/files/lib/wee/core/presenter_rb.html +1 -1
  94. data/doc/rdoc/files/lib/wee/core_rb.html +3 -3
  95. data/doc/rdoc/files/lib/wee/databases/og_rb.html +108 -0
  96. data/doc/rdoc/files/lib/wee/renderer/html/brushes_rb.html +1 -1
  97. data/doc/rdoc/files/lib/wee/renderer/html/canvas_rb.html +1 -1
  98. data/doc/rdoc/files/lib/wee/renderer/html/writer_rb.html +1 -1
  99. data/doc/rdoc/files/lib/wee/requesthandler_rb.html +1 -1
  100. data/doc/rdoc/files/lib/wee/session_rb.html +1 -2
  101. data/doc/rdoc/files/lib/wee/utils/autoreload_rb.html +1 -1
  102. data/doc/rdoc/files/lib/wee/utils/cache_rb.html +1 -1
  103. data/doc/rdoc/files/lib/wee/utils/helper_rb.html +1 -8
  104. data/doc/rdoc/files/lib/wee/utils_rb.html +110 -0
  105. data/doc/rdoc/files/lib/wee_rb.html +1 -1
  106. data/doc/rdoc/fr_class_index.html +11 -1
  107. data/doc/rdoc/fr_file_index.html +8 -0
  108. data/doc/rdoc/fr_method_index.html +269 -228
  109. data/examples/calculator.rb +69 -0
  110. data/examples/calendar.rb +5 -17
  111. data/examples/example.rb +2 -2
  112. data/examples/hw.rb +17 -0
  113. data/examples/live-update.rb +45 -0
  114. data/examples/og-test.rb +51 -0
  115. data/lib/wee.rb +1 -1
  116. data/lib/wee/adaptors/webrick.rb +2 -0
  117. data/lib/wee/application.rb +16 -0
  118. data/lib/wee/components.rb +3 -0
  119. data/lib/wee/components/form_decoration.rb +7 -0
  120. data/{test → lib/wee}/components/messagebox.rb +1 -1
  121. data/lib/wee/components/page_decoration.rb +5 -5
  122. data/lib/wee/components/wrapper_decoration.rb +7 -0
  123. data/lib/wee/continuation.rb +5 -0
  124. data/lib/wee/continuation/core/component.rb +55 -0
  125. data/lib/wee/continuation/session.rb +217 -0
  126. data/lib/wee/core/callback.rb +11 -6
  127. data/lib/wee/core/component.rb +45 -33
  128. data/lib/wee/core/presenter.rb +68 -0
  129. data/lib/wee/databases/og.rb +114 -0
  130. data/lib/wee/renderer/html/brushes.rb +179 -98
  131. data/lib/wee/renderer/html/canvas.rb +37 -13
  132. data/lib/wee/renderer/html/writer.rb +34 -32
  133. data/lib/wee/requesthandler.rb +6 -3
  134. data/lib/wee/session.rb +73 -54
  135. data/lib/wee/utils.rb +5 -0
  136. data/lib/wee/utils/autoreload.rb +1 -1
  137. data/lib/wee/utils/cache.rb +0 -2
  138. data/lib/wee/utils/helper.rb +40 -8
  139. data/test/components/calltest-cont.rb +16 -0
  140. data/test/components/calltest.rb +15 -10
  141. data/test/stress.rb +31 -28
  142. data/test/stress_and_measure.rb +53 -0
  143. data/test/stressed_application.rb +15 -0
  144. data/test/test_html_writer.rb +9 -4
  145. metadata +236 -195
  146. data/benchmark/bench.sh +0 -24
@@ -65,8 +65,8 @@
65
65
  <tr class="top-aligned-row">
66
66
  <td><strong>Parent:</strong></td>
67
67
  <td>
68
- <a href="Decoration.html">
69
- Wee::Decoration
68
+ <a href="WrapperDecoration.html">
69
+ Wee::WrapperDecoration
70
70
  </a>
71
71
  </td>
72
72
  </tr>
@@ -88,9 +88,9 @@
88
88
  <h3 class="section-bar">Methods</h3>
89
89
 
90
90
  <div class="name-list">
91
- <a href="#M000211">do_render</a>&nbsp;&nbsp;
92
- <a href="#M000210">global?</a>&nbsp;&nbsp;
93
- <a href="#M000209">new</a>&nbsp;&nbsp;
91
+ <a href="#M000251">global?</a>&nbsp;&nbsp;
92
+ <a href="#M000250">new</a>&nbsp;&nbsp;
93
+ <a href="#M000252">render_wrapper</a>&nbsp;&nbsp;
94
94
  </div>
95
95
  </div>
96
96
 
@@ -112,19 +112,19 @@
112
112
  <div id="methods">
113
113
  <h3 class="section-bar">Public Class methods</h3>
114
114
 
115
- <div id="method-M000209" class="method-detail">
116
- <a name="M000209"></a>
115
+ <div id="method-M000250" class="method-detail">
116
+ <a name="M000250"></a>
117
117
 
118
118
  <div class="method-heading">
119
- <a href="#M000209" class="method-signature">
119
+ <a href="#M000250" class="method-signature">
120
120
  <span class="method-name">new</span><span class="method-args">(title='')</span>
121
121
  </a>
122
122
  </div>
123
123
 
124
124
  <div class="method-description">
125
125
  <p><a class="source-toggle" href="#"
126
- onclick="toggleCode('M000209-source');return false;">[Source]</a></p>
127
- <div class="method-source-code" id="M000209-source">
126
+ onclick="toggleCode('M000250-source');return false;">[Source]</a></p>
127
+ <div class="method-source-code" id="M000250-source">
128
128
  <pre>
129
129
  <span class="ruby-comment cmt"># File lib/wee/components/page_decoration.rb, line 2</span>
130
130
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">title</span>=<span class="ruby-value str">''</span>)
@@ -138,47 +138,47 @@
138
138
 
139
139
  <h3 class="section-bar">Public Instance methods</h3>
140
140
 
141
- <div id="method-M000211" class="method-detail">
142
- <a name="M000211"></a>
141
+ <div id="method-M000251" class="method-detail">
142
+ <a name="M000251"></a>
143
143
 
144
144
  <div class="method-heading">
145
- <a href="#M000211" class="method-signature">
146
- <span class="method-name">do_render</span><span class="method-args">(rendering_context)</span>
145
+ <a href="#M000251" class="method-signature">
146
+ <span class="method-name">global?</span><span class="method-args">()</span>
147
147
  </a>
148
148
  </div>
149
149
 
150
150
  <div class="method-description">
151
151
  <p><a class="source-toggle" href="#"
152
- onclick="toggleCode('M000211-source');return false;">[Source]</a></p>
153
- <div class="method-source-code" id="M000211-source">
152
+ onclick="toggleCode('M000251-source');return false;">[Source]</a></p>
153
+ <div class="method-source-code" id="M000251-source">
154
154
  <pre>
155
- <span class="ruby-comment cmt"># File lib/wee/components/page_decoration.rb, line 9</span>
156
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">do_render</span>(<span class="ruby-identifier">rendering_context</span>)
157
- <span class="ruby-identifier">with_renderer_for</span>(<span class="ruby-identifier">rendering_context</span>) <span class="ruby-keyword kw">do</span>
158
- <span class="ruby-identifier">r</span>.<span class="ruby-identifier">page</span>.<span class="ruby-identifier">title</span>(<span class="ruby-ivar">@title</span>).<span class="ruby-identifier">with</span> { <span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">rendering_context</span>) }
159
- <span class="ruby-keyword kw">end</span>
160
- <span class="ruby-keyword kw">end</span>
155
+ <span class="ruby-comment cmt"># File lib/wee/components/page_decoration.rb, line 7</span>
156
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">global?</span>() <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">end</span>
161
157
  </pre>
162
158
  </div>
163
159
  </div>
164
160
  </div>
165
161
 
166
- <div id="method-M000210" class="method-detail">
167
- <a name="M000210"></a>
162
+ <h3 class="section-bar">Private Instance methods</h3>
163
+
164
+ <div id="method-M000252" class="method-detail">
165
+ <a name="M000252"></a>
168
166
 
169
167
  <div class="method-heading">
170
- <a href="#M000210" class="method-signature">
171
- <span class="method-name">global?</span><span class="method-args">()</span>
168
+ <a href="#M000252" class="method-signature">
169
+ <span class="method-name">render_wrapper</span><span class="method-args">() {|| ...}</span>
172
170
  </a>
173
171
  </div>
174
172
 
175
173
  <div class="method-description">
176
174
  <p><a class="source-toggle" href="#"
177
- onclick="toggleCode('M000210-source');return false;">[Source]</a></p>
178
- <div class="method-source-code" id="M000210-source">
175
+ onclick="toggleCode('M000252-source');return false;">[Source]</a></p>
176
+ <div class="method-source-code" id="M000252-source">
179
177
  <pre>
180
- <span class="ruby-comment cmt"># File lib/wee/components/page_decoration.rb, line 7</span>
181
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">global?</span>() <span class="ruby-keyword kw">true</span> <span class="ruby-keyword kw">end</span>
178
+ <span class="ruby-comment cmt"># File lib/wee/components/page_decoration.rb, line 11</span>
179
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render_wrapper</span>
180
+ <span class="ruby-identifier">r</span>.<span class="ruby-identifier">page</span>.<span class="ruby-identifier">title</span>(<span class="ruby-ivar">@title</span>).<span class="ruby-identifier">with</span> { <span class="ruby-keyword kw">yield</span> }
181
+ <span class="ruby-keyword kw">end</span>
182
182
  </pre>
183
183
  </div>
184
184
  </div>
@@ -95,10 +95,11 @@ important subclasses.
95
95
  <div id="contents-list">
96
96
  <h3 class="section-bar">Contents</h3>
97
97
  <ul>
98
- <li><a href="#SEC00083">Render</a></li>
99
- <li><a href="#SEC00084">Callback</a></li>
100
- <li><a href="#SEC00085">Backtrack</a></li>
101
- <li><a href="#SEC00086">Session</a></li>
98
+ <li><a href="#SEC00091">Render</a></li>
99
+ <li><a href="#SEC00092">Callback</a></li>
100
+ <li><a href="#SEC00093">Backtrack</a></li>
101
+ <li><a href="#SEC00094">Session</a></li>
102
+ <li><a href="#SEC00095">Properties</a></li>
102
103
  </ul>
103
104
  </div>
104
105
 
@@ -106,15 +107,18 @@ important subclasses.
106
107
  <h3 class="section-bar">Methods</h3>
107
108
 
108
109
  <div class="name-list">
109
- <a href="#M000197">backtrack_state</a>&nbsp;&nbsp;
110
- <a href="#M000191">do_render</a>&nbsp;&nbsp;
111
- <a href="#M000196">process_callbacks</a>&nbsp;&nbsp;
112
- <a href="#M000193">r</a>&nbsp;&nbsp;
113
- <a href="#M000190">render</a>&nbsp;&nbsp;
114
- <a href="#M000192">renderer</a>&nbsp;&nbsp;
115
- <a href="#M000195">renderer_class</a>&nbsp;&nbsp;
116
- <a href="#M000198">session</a>&nbsp;&nbsp;
117
- <a href="#M000194">with_renderer_for</a>&nbsp;&nbsp;
110
+ <a href="#M000235">backtrack_state</a>&nbsp;&nbsp;
111
+ <a href="#M000229">do_render</a>&nbsp;&nbsp;
112
+ <a href="#M000237">get_property</a>&nbsp;&nbsp;
113
+ <a href="#M000238">lookup_property</a>&nbsp;&nbsp;
114
+ <a href="#M000234">process_callbacks</a>&nbsp;&nbsp;
115
+ <a href="#M000231">r</a>&nbsp;&nbsp;
116
+ <a href="#M000228">render</a>&nbsp;&nbsp;
117
+ <a href="#M000230">renderer</a>&nbsp;&nbsp;
118
+ <a href="#M000233">renderer_class</a>&nbsp;&nbsp;
119
+ <a href="#M000236">session</a>&nbsp;&nbsp;
120
+ <a href="#M000239">uses_property</a>&nbsp;&nbsp;
121
+ <a href="#M000232">with_renderer_for</a>&nbsp;&nbsp;
118
122
  </div>
119
123
  </div>
120
124
 
@@ -134,7 +138,7 @@ important subclasses.
134
138
 
135
139
  <!-- if method_list -->
136
140
  <div id="section">
137
- <h2 class="section-title"><a name="SEC00083">Render</a></h2>
141
+ <h2 class="section-title"><a name="SEC00091">Render</a></h2>
138
142
  <div class="section-comment">
139
143
 
140
144
  </div>
@@ -150,11 +154,11 @@ important subclasses.
150
154
  <div id="methods">
151
155
  <h3 class="section-bar">Public Instance methods</h3>
152
156
 
153
- <div id="method-M000191" class="method-detail">
154
- <a name="M000191"></a>
157
+ <div id="method-M000229" class="method-detail">
158
+ <a name="M000229"></a>
155
159
 
156
160
  <div class="method-heading">
157
- <a href="#M000191" class="method-signature">
161
+ <a href="#M000229" class="method-signature">
158
162
  <span class="method-name">do_render</span><span class="method-args">(rendering_context)</span>
159
163
  </a>
160
164
  </div>
@@ -166,8 +170,8 @@ overwrite this method, unless you know exactly what you&#8217;re doing!
166
170
  </p>
167
171
  <p>
168
172
  Creates a new renderer object of the class returned by method <a
169
- href="Presenter.html#M000195">renderer_class</a>, makes this the current
170
- renderer, then invokes method <a href="Presenter.html#M000190">render</a>.
173
+ href="Presenter.html#M000233">renderer_class</a>, makes this the current
174
+ renderer, then invokes method <a href="Presenter.html#M000228">render</a>.
171
175
  </p>
172
176
  <dl>
173
177
  <dt><tt>rendering_context</tt></dt><dd>An object of class <a href="RenderingContext.html">RenderingContext</a>
@@ -175,8 +179,8 @@ renderer, then invokes method <a href="Presenter.html#M000190">render</a>.
175
179
  </dd>
176
180
  </dl>
177
181
  <p><a class="source-toggle" href="#"
178
- onclick="toggleCode('M000191-source');return false;">[Source]</a></p>
179
- <div class="method-source-code" id="M000191-source">
182
+ onclick="toggleCode('M000229-source');return false;">[Source]</a></p>
183
+ <div class="method-source-code" id="M000229-source">
180
184
  <pre>
181
185
  <span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 33</span>
182
186
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">do_render</span>(<span class="ruby-identifier">rendering_context</span>)
@@ -187,11 +191,11 @@ renderer, then invokes method <a href="Presenter.html#M000190">render</a>.
187
191
  </div>
188
192
  </div>
189
193
 
190
- <div id="method-M000190" class="method-detail">
191
- <a name="M000190"></a>
194
+ <div id="method-M000228" class="method-detail">
195
+ <a name="M000228"></a>
192
196
 
193
197
  <div class="method-heading">
194
- <a href="#M000190" class="method-signature">
198
+ <a href="#M000228" class="method-signature">
195
199
  <span class="method-name">render</span><span class="method-args">()</span>
196
200
  </a>
197
201
  </div>
@@ -206,12 +210,12 @@ view. By default this method does nothing!
206
210
  </p>
207
211
  <p>
208
212
  Use the current renderer as returned by <a
209
- href="Presenter.html#M000192">renderer</a> or it&#8217;s short-cut <a
210
- href="Presenter.html#M000193">r</a>.
213
+ href="Presenter.html#M000230">renderer</a> or it&#8217;s short-cut <a
214
+ href="Presenter.html#M000231">r</a>.
211
215
  </p>
212
216
  <p><a class="source-toggle" href="#"
213
- onclick="toggleCode('M000190-source');return false;">[Source]</a></p>
214
- <div class="method-source-code" id="M000190-source">
217
+ onclick="toggleCode('M000228-source');return false;">[Source]</a></p>
218
+ <div class="method-source-code" id="M000228-source">
215
219
  <pre>
216
220
  <span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 20</span>
217
221
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render</span>
@@ -223,22 +227,22 @@ href="Presenter.html#M000193">r</a>.
223
227
 
224
228
  <h3 class="section-bar">Protected Instance methods</h3>
225
229
 
226
- <div id="method-M000193" class="method-detail">
227
- <a name="M000193"></a>
230
+ <div id="method-M000231" class="method-detail">
231
+ <a name="M000231"></a>
228
232
 
229
233
  <div class="method-heading">
230
- <a href="#M000193" class="method-signature">
234
+ <a href="#M000231" class="method-signature">
231
235
  <span class="method-name">r</span><span class="method-args">()</span>
232
236
  </a>
233
237
  </div>
234
238
 
235
239
  <div class="method-description">
236
240
  <p>
237
- Short cut for <a href="Presenter.html#M000192">renderer</a>.
241
+ Short cut for <a href="Presenter.html#M000230">renderer</a>.
238
242
  </p>
239
243
  <p><a class="source-toggle" href="#"
240
- onclick="toggleCode('M000193-source');return false;">[Source]</a></p>
241
- <div class="method-source-code" id="M000193-source">
244
+ onclick="toggleCode('M000231-source');return false;">[Source]</a></p>
245
+ <div class="method-source-code" id="M000231-source">
242
246
  <pre>
243
247
  <span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 43</span>
244
248
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">r</span>() <span class="ruby-ivar">@renderer</span> <span class="ruby-keyword kw">end</span>
@@ -247,11 +251,11 @@ Short cut for <a href="Presenter.html#M000192">renderer</a>.
247
251
  </div>
248
252
  </div>
249
253
 
250
- <div id="method-M000192" class="method-detail">
251
- <a name="M000192"></a>
254
+ <div id="method-M000230" class="method-detail">
255
+ <a name="M000230"></a>
252
256
 
253
257
  <div class="method-heading">
254
- <a href="#M000192" class="method-signature">
258
+ <a href="#M000230" class="method-signature">
255
259
  <span class="method-name">renderer</span><span class="method-args">()</span>
256
260
  </a>
257
261
  </div>
@@ -261,8 +265,8 @@ Short cut for <a href="Presenter.html#M000192">renderer</a>.
261
265
  Returns the current renderer object for use by the render methods.
262
266
  </p>
263
267
  <p><a class="source-toggle" href="#"
264
- onclick="toggleCode('M000192-source');return false;">[Source]</a></p>
265
- <div class="method-source-code" id="M000192-source">
268
+ onclick="toggleCode('M000230-source');return false;">[Source]</a></p>
269
+ <div class="method-source-code" id="M000230-source">
266
270
  <pre>
267
271
  <span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 40</span>
268
272
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">renderer</span>() <span class="ruby-ivar">@renderer</span> <span class="ruby-keyword kw">end</span>
@@ -271,11 +275,11 @@ Returns the current renderer object for use by the render methods.
271
275
  </div>
272
276
  </div>
273
277
 
274
- <div id="method-M000195" class="method-detail">
275
- <a name="M000195"></a>
278
+ <div id="method-M000233" class="method-detail">
279
+ <a name="M000233"></a>
276
280
 
277
281
  <div class="method-heading">
278
- <a href="#M000195" class="method-signature">
282
+ <a href="#M000233" class="method-signature">
279
283
  <span class="method-name">renderer_class</span><span class="method-args">()</span>
280
284
  </a>
281
285
  </div>
@@ -286,8 +290,8 @@ Returns the class used as renderer for this presenter. Overwrite this
286
290
  method if you want to use a different renderer.
287
291
  </p>
288
292
  <p><a class="source-toggle" href="#"
289
- onclick="toggleCode('M000195-source');return false;">[Source]</a></p>
290
- <div class="method-source-code" id="M000195-source">
293
+ onclick="toggleCode('M000233-source');return false;">[Source]</a></p>
294
+ <div class="method-source-code" id="M000233-source">
291
295
  <pre>
292
296
  <span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 66</span>
293
297
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">renderer_class</span>
@@ -298,11 +302,11 @@ method if you want to use a different renderer.
298
302
  </div>
299
303
  </div>
300
304
 
301
- <div id="method-M000194" class="method-detail">
302
- <a name="M000194"></a>
305
+ <div id="method-M000232" class="method-detail">
306
+ <a name="M000232"></a>
303
307
 
304
308
  <div class="method-heading">
305
- <a href="#M000194" class="method-signature">
309
+ <a href="#M000232" class="method-signature">
306
310
  <span class="method-name">with_renderer_for</span><span class="method-args">(rendering_context) {|| ...}</span>
307
311
  </a>
308
312
  </div>
@@ -310,14 +314,14 @@ method if you want to use a different renderer.
310
314
  <div class="method-description">
311
315
  <p>
312
316
  Creates a new renderer object of the class returned by method <a
313
- href="Presenter.html#M000195">renderer_class</a>, then makes this the
317
+ href="Presenter.html#M000233">renderer_class</a>, then makes this the
314
318
  current renderer for the time the block it yields to executes. Finally, it
315
319
  restores the current renderer to the former one and closes the newly
316
320
  created renderer.
317
321
  </p>
318
322
  <p><a class="source-toggle" href="#"
319
- onclick="toggleCode('M000194-source');return false;">[Source]</a></p>
320
- <div class="method-source-code" id="M000194-source">
323
+ onclick="toggleCode('M000232-source');return false;">[Source]</a></p>
324
+ <div class="method-source-code" id="M000232-source">
321
325
  <pre>
322
326
  <span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 50</span>
323
327
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with_renderer_for</span>(<span class="ruby-identifier">rendering_context</span>)
@@ -340,7 +344,7 @@ created renderer.
340
344
 
341
345
  </div>
342
346
  <div id="section">
343
- <h2 class="section-title"><a name="SEC00084">Callback</a></h2>
347
+ <h2 class="section-title"><a name="SEC00092">Callback</a></h2>
344
348
  <div class="section-comment">
345
349
 
346
350
  </div>
@@ -356,11 +360,11 @@ created renderer.
356
360
  <div id="methods">
357
361
  <h3 class="section-bar">Public Instance methods</h3>
358
362
 
359
- <div id="method-M000196" class="method-detail">
360
- <a name="M000196"></a>
363
+ <div id="method-M000234" class="method-detail">
364
+ <a name="M000234"></a>
361
365
 
362
366
  <div class="method-heading">
363
- <a href="#M000196" class="method-signature">
367
+ <a href="#M000234" class="method-signature">
364
368
  <span class="method-name">process_callbacks</span><span class="method-args">(callback_stream) {|| ...}</span>
365
369
  </a>
366
370
  </div>
@@ -383,8 +387,8 @@ NOTE: Input callbacks should never call other components!
383
387
  </dd>
384
388
  </dl>
385
389
  <p><a class="source-toggle" href="#"
386
- onclick="toggleCode('M000196-source');return false;">[Source]</a></p>
387
- <div class="method-source-code" id="M000196-source">
390
+ onclick="toggleCode('M000234-source');return false;">[Source]</a></p>
391
+ <div class="method-source-code" id="M000234-source">
388
392
  <pre>
389
393
  <span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 87</span>
390
394
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_callbacks</span>(<span class="ruby-identifier">callback_stream</span>) <span class="ruby-comment cmt"># :yields:</span>
@@ -411,7 +415,7 @@ NOTE: Input callbacks should never call other components!
411
415
 
412
416
  </div>
413
417
  <div id="section">
414
- <h2 class="section-title"><a name="SEC00085">Backtrack</a></h2>
418
+ <h2 class="section-title"><a name="SEC00093">Backtrack</a></h2>
415
419
  <div class="section-comment">
416
420
 
417
421
  </div>
@@ -427,11 +431,11 @@ NOTE: Input callbacks should never call other components!
427
431
  <div id="methods">
428
432
  <h3 class="section-bar">Public Instance methods</h3>
429
433
 
430
- <div id="method-M000197" class="method-detail">
431
- <a name="M000197"></a>
434
+ <div id="method-M000235" class="method-detail">
435
+ <a name="M000235"></a>
432
436
 
433
437
  <div class="method-heading">
434
- <a href="#M000197" class="method-signature">
438
+ <a href="#M000235" class="method-signature">
435
439
  <span class="method-name">backtrack_state</span><span class="method-args">(snapshot)</span>
436
440
  </a>
437
441
  </div>
@@ -439,7 +443,7 @@ NOTE: Input callbacks should never call other components!
439
443
  <div class="method-description">
440
444
  <p>
441
445
  Dummy implementation. See <a
442
- href="Component.html#M000186">Component#backtrack_state</a> for more
446
+ href="Component.html#M000222">Component#backtrack_state</a> for more
443
447
  information.
444
448
  </p>
445
449
  <dl>
@@ -448,8 +452,8 @@ information.
448
452
  </dd>
449
453
  </dl>
450
454
  <p><a class="source-toggle" href="#"
451
- onclick="toggleCode('M000197-source');return false;">[Source]</a></p>
452
- <div class="method-source-code" id="M000197-source">
455
+ onclick="toggleCode('M000235-source');return false;">[Source]</a></p>
456
+ <div class="method-source-code" id="M000235-source">
453
457
  <pre>
454
458
  <span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 115</span>
455
459
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">backtrack_state</span>(<span class="ruby-identifier">snapshot</span>)
@@ -462,7 +466,7 @@ information.
462
466
 
463
467
  </div>
464
468
  <div id="section">
465
- <h2 class="section-title"><a name="SEC00086">Session</a></h2>
469
+ <h2 class="section-title"><a name="SEC00094">Session</a></h2>
466
470
  <div class="section-comment">
467
471
 
468
472
  </div>
@@ -478,11 +482,11 @@ information.
478
482
  <div id="methods">
479
483
  <h3 class="section-bar">Public Instance methods</h3>
480
484
 
481
- <div id="method-M000198" class="method-detail">
482
- <a name="M000198"></a>
485
+ <div id="method-M000236" class="method-detail">
486
+ <a name="M000236"></a>
483
487
 
484
488
  <div class="method-heading">
485
- <a href="#M000198" class="method-signature">
489
+ <a href="#M000236" class="method-signature">
486
490
  <span class="method-name">session</span><span class="method-args">()</span>
487
491
  </a>
488
492
  </div>
@@ -494,8 +498,8 @@ associated session. The returned object is of class <a
494
498
  href="Session.html">Wee::Session</a> or a subclass thereof.
495
499
  </p>
496
500
  <p><a class="source-toggle" href="#"
497
- onclick="toggleCode('M000198-source');return false;">[Source]</a></p>
498
- <div class="method-source-code" id="M000198-source">
501
+ onclick="toggleCode('M000236-source');return false;">[Source]</a></p>
502
+ <div class="method-source-code" id="M000236-source">
499
503
  <pre>
500
504
  <span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 128</span>
501
505
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">session</span>
@@ -508,6 +512,170 @@ href="Session.html">Wee::Session</a> or a subclass thereof.
508
512
 
509
513
 
510
514
  </div>
515
+ <div id="section">
516
+ <h2 class="section-title"><a name="SEC00095">Properties</a></h2>
517
+ <div class="section-comment">
518
+
519
+ </div>
520
+
521
+
522
+
523
+
524
+
525
+ <div id="attribute-list">
526
+ <h3 class="section-bar">Attributes</h3>
527
+
528
+ <div class="name-list">
529
+ <table>
530
+ <tr class="top-aligned-row context-row">
531
+ <td class="context-item-name">properties</td>
532
+ <td class="context-item-value">&nbsp;[RW]&nbsp;</td>
533
+ <td class="context-item-desc"></td>
534
+ </tr>
535
+ </table>
536
+ </div>
537
+ </div>
538
+
539
+
540
+
541
+ <!-- if method_list -->
542
+ <div id="methods">
543
+ <h3 class="section-bar">Public Class methods</h3>
544
+
545
+ <div id="method-M000239" class="method-detail">
546
+ <a name="M000239"></a>
547
+
548
+ <div class="method-heading">
549
+ <a href="#M000239" class="method-signature">
550
+ <span class="method-name">uses_property</span><span class="method-args">(*args)</span>
551
+ </a>
552
+ </div>
553
+
554
+ <div class="method-description">
555
+ <p>
556
+ This is currently only used for describing which properties are required by
557
+ the underlying component.
558
+ </p>
559
+ <p><a class="source-toggle" href="#"
560
+ onclick="toggleCode('M000239-source');return false;">[Source]</a></p>
561
+ <div class="method-source-code" id="M000239-source">
562
+ <pre>
563
+ <span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 197</span>
564
+ <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">uses_property</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
565
+ <span class="ruby-keyword kw">end</span>
566
+ </pre>
567
+ </div>
568
+ </div>
569
+ </div>
570
+
571
+ <h3 class="section-bar">Public Instance methods</h3>
572
+
573
+ <div id="method-M000237" class="method-detail">
574
+ <a name="M000237"></a>
575
+
576
+ <div class="method-heading">
577
+ <a href="#M000237" class="method-signature">
578
+ <span class="method-name">get_property</span><span class="method-args">(prop)</span>
579
+ </a>
580
+ </div>
581
+
582
+ <div class="method-description">
583
+ <p>
584
+ Returns an &quot;owned&quot; property.
585
+ </p>
586
+ <p><a class="source-toggle" href="#"
587
+ onclick="toggleCode('M000237-source');return false;">[Source]</a></p>
588
+ <div class="method-source-code" id="M000237-source">
589
+ <pre>
590
+ <span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 140</span>
591
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_property</span>(<span class="ruby-identifier">prop</span>)
592
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@properties</span>
593
+ <span class="ruby-ivar">@properties</span>[<span class="ruby-identifier">prop</span>]
594
+ <span class="ruby-keyword kw">else</span>
595
+ <span class="ruby-keyword kw">nil</span>
596
+ <span class="ruby-keyword kw">end</span>
597
+ <span class="ruby-keyword kw">end</span>
598
+ </pre>
599
+ </div>
600
+ </div>
601
+ </div>
602
+
603
+ <div id="method-M000238" class="method-detail">
604
+ <a name="M000238"></a>
605
+
606
+ <div class="method-heading">
607
+ <a href="#M000238" class="method-signature">
608
+ <span class="method-name">lookup_property</span><span class="method-args">(prop)</span>
609
+ </a>
610
+ </div>
611
+
612
+ <div class="method-description">
613
+ <p>
614
+ Tries to lookup a property from different places. <tt>nil</tt> as property
615
+ value is not allowed!
616
+ </p>
617
+ <p>
618
+ Search order:
619
+ </p>
620
+ <ol>
621
+ <li>self.get_property(prop)
622
+
623
+ </li>
624
+ <li>session.get_property(prop, self.class)
625
+
626
+ </li>
627
+ <li>application.get_property(prop, self.class)
628
+
629
+ </li>
630
+ <li>session.get_property(prop, nil)
631
+
632
+ </li>
633
+ <li>application.get_property(prop, nil)
634
+
635
+ </li>
636
+ <li>@@properties[prop]
637
+
638
+ </li>
639
+ </ol>
640
+ <p><a class="source-toggle" href="#"
641
+ onclick="toggleCode('M000238-source');return false;">[Source]</a></p>
642
+ <div class="method-source-code" id="M000238-source">
643
+ <pre>
644
+ <span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 166</span>
645
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lookup_property</span>(<span class="ruby-identifier">prop</span>)
646
+ <span class="ruby-identifier">val</span> = <span class="ruby-identifier">get_property</span>(<span class="ruby-identifier">prop</span>)
647
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
648
+
649
+ <span class="ruby-identifier">sess</span> = <span class="ruby-identifier">session</span>()
650
+ <span class="ruby-identifier">app</span> = <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">application</span>
651
+ <span class="ruby-identifier">klass</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>
652
+
653
+ <span class="ruby-identifier">val</span> = <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">get_property</span>(<span class="ruby-identifier">prop</span>, <span class="ruby-identifier">klass</span>)
654
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
655
+
656
+ <span class="ruby-identifier">val</span> = <span class="ruby-identifier">app</span>.<span class="ruby-identifier">get_property</span>(<span class="ruby-identifier">prop</span>, <span class="ruby-identifier">klass</span>)
657
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
658
+
659
+ <span class="ruby-identifier">val</span> = <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">get_property</span>(<span class="ruby-identifier">prop</span>, <span class="ruby-keyword kw">nil</span>)
660
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
661
+
662
+ <span class="ruby-identifier">val</span> = <span class="ruby-identifier">app</span>.<span class="ruby-identifier">get_property</span>(<span class="ruby-identifier">prop</span>, <span class="ruby-keyword kw">nil</span>)
663
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
664
+
665
+ <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-ivar">@@properties</span>)
666
+ <span class="ruby-identifier">val</span> = <span class="ruby-ivar">@@properties</span>[<span class="ruby-identifier">prop</span>]
667
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">val</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
668
+ <span class="ruby-keyword kw">end</span>
669
+
670
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
671
+ <span class="ruby-keyword kw">end</span>
672
+ </pre>
673
+ </div>
674
+ </div>
675
+ </div>
676
+
677
+
678
+ </div>
511
679
 
512
680
 
513
681
  </div>