wee 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +286 -0
- data/Features +185 -0
- data/doc/rdoc/classes/ActionView.html +107 -0
- data/doc/rdoc/classes/ActionView/Base.html +133 -0
- data/doc/rdoc/classes/Array.html +7 -59
- data/doc/rdoc/classes/Cache/StorageCache.html +38 -38
- data/doc/rdoc/classes/Cache/Strategy/CapacityBounded.html +30 -30
- data/doc/rdoc/classes/Cache/Strategy/LFU.html +24 -24
- data/doc/rdoc/classes/Cache/Strategy/LRU.html +24 -24
- data/doc/rdoc/classes/Cache/Strategy/Unbounded.html +24 -24
- data/doc/rdoc/classes/Enumerable.html +6 -6
- data/doc/rdoc/classes/Hash.html +120 -0
- data/doc/rdoc/classes/Main.html +58 -34
- data/doc/rdoc/classes/Object.html +12 -12
- data/doc/rdoc/classes/OgScaffolder.html +165 -166
- data/doc/rdoc/classes/OgScaffolder/Editor.html +112 -112
- data/doc/rdoc/classes/String.html +7 -59
- data/doc/rdoc/classes/Struct.html +14 -14
- data/doc/rdoc/classes/Wee.html +70 -6
- data/doc/rdoc/classes/Wee/AbstractSession.html +502 -0
- data/doc/rdoc/classes/Wee/AnswerDecoration.html +11 -11
- data/doc/rdoc/classes/Wee/Application.html +139 -84
- data/doc/rdoc/classes/Wee/Brush.html +21 -18
- data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +90 -17
- data/doc/rdoc/classes/Wee/Brush/CheckboxTag.html +162 -0
- data/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/FormTag.html +41 -17
- data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +12 -12
- data/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +112 -86
- data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +12 -12
- data/doc/rdoc/classes/Wee/Brush/HiddenInputTag.html +160 -0
- data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +15 -15
- data/doc/rdoc/classes/Wee/Brush/ImageTag.html +21 -21
- data/doc/rdoc/classes/Wee/Brush/InputTag.html +14 -14
- data/doc/rdoc/classes/Wee/Brush/JavascriptTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/Page.html +14 -14
- data/doc/rdoc/classes/Wee/Brush/RadioButtonTag.html +234 -0
- data/doc/rdoc/classes/Wee/Brush/RadioButtonTag/RadioGroup.html +207 -0
- data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +124 -28
- data/doc/rdoc/classes/Wee/Brush/SelectListTag/SelectListCallback.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/TableDataTag.html +14 -14
- data/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/TableRowTag.html +42 -42
- data/doc/rdoc/classes/Wee/Brush/TableTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +48 -15
- data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +7 -7
- data/doc/rdoc/classes/Wee/CallbackRegistry.html +38 -38
- data/doc/rdoc/classes/Wee/CallbackStream.html +18 -18
- data/doc/rdoc/classes/Wee/CanvasMixin.html +225 -0
- data/doc/rdoc/classes/Wee/Component.html +202 -201
- data/doc/rdoc/classes/Wee/Component/OnAnswer.html +7 -7
- data/doc/rdoc/classes/Wee/ComponentDispatcher.html +289 -0
- data/doc/rdoc/classes/Wee/ComponentRunner.html +321 -0
- data/doc/rdoc/classes/Wee/Context.html +63 -3
- data/doc/rdoc/classes/Wee/Decoration.html +45 -45
- data/doc/rdoc/classes/Wee/Delegate.html +30 -30
- data/doc/rdoc/classes/Wee/DupReplaceSnapshotMixin.html +164 -0
- data/doc/rdoc/classes/Wee/ErrorResponse.html +16 -16
- data/doc/rdoc/classes/Wee/Examples.html +114 -0
- data/doc/rdoc/classes/Wee/Examples/Calculator.html +319 -0
- data/doc/rdoc/classes/Wee/Examples/Counter.html +289 -0
- data/doc/rdoc/classes/Wee/Examples/EditableCounter.html +210 -0
- data/doc/rdoc/classes/Wee/Examples/Window.html +346 -0
- data/doc/rdoc/classes/Wee/FastCGIAdaptor.html +227 -0
- data/doc/rdoc/classes/Wee/FormDecoration.html +6 -6
- data/doc/rdoc/classes/Wee/GenericResponse.html +7 -7
- data/doc/rdoc/classes/Wee/HtmlCanvasRenderer.html +1230 -0
- data/doc/rdoc/classes/Wee/HtmlWriter.html +40 -40
- data/doc/rdoc/classes/Wee/IdGenerator.html +148 -0
- data/doc/rdoc/classes/Wee/LiteralMethodCallback.html +27 -14
- data/doc/rdoc/classes/Wee/LoginDecoration.html +261 -0
- data/doc/rdoc/classes/Wee/Md5IdGenerator.html +14 -14
- data/doc/rdoc/classes/Wee/MessageBox.html +14 -14
- data/doc/rdoc/classes/Wee/Nitro.html +114 -0
- data/doc/rdoc/classes/Wee/Nitro/ControllerClassMixin.html +192 -0
- data/doc/rdoc/classes/Wee/Nitro/ControllerMixin.html +345 -0
- data/doc/rdoc/classes/Wee/Nitro/FormTag.html +155 -0
- data/doc/rdoc/classes/Wee/Nitro/HtmlCanvasRenderer.html +178 -0
- data/doc/rdoc/classes/Wee/Page.html +4 -0
- data/doc/rdoc/classes/Wee/PageDecoration.html +18 -18
- data/doc/rdoc/classes/Wee/PagelessApplication.html +13 -11
- data/doc/rdoc/classes/Wee/PagelessComponentDriver.html +296 -0
- data/doc/rdoc/classes/Wee/PagelessRequest.html +52 -21
- data/doc/rdoc/classes/Wee/PagelessSession.html +130 -91
- data/doc/rdoc/classes/Wee/Pager.html +534 -0
- data/doc/rdoc/classes/Wee/Presenter.html +482 -298
- data/doc/rdoc/classes/Wee/Rails.html +114 -0
- data/doc/rdoc/classes/Wee/Rails/ControllerClassMixin.html +192 -0
- data/doc/rdoc/classes/Wee/Rails/ControllerMixin.html +342 -0
- data/doc/rdoc/classes/Wee/Rails/FormTag.html +155 -0
- data/doc/rdoc/classes/Wee/Rails/HtmlCanvasRenderer.html +177 -0
- data/doc/rdoc/classes/Wee/RedirectResponse.html +7 -7
- data/doc/rdoc/classes/Wee/RefreshResponse.html +7 -7
- data/doc/rdoc/classes/Wee/Renderer.html +208 -0
- data/doc/rdoc/classes/Wee/RenderingContext.html +175 -3
- data/doc/rdoc/classes/Wee/Request.html +197 -46
- data/doc/rdoc/classes/Wee/RequestHandler.html +31 -31
- data/doc/rdoc/classes/Wee/Response.html +44 -43
- data/doc/rdoc/classes/Wee/Session.html +296 -402
- data/doc/rdoc/classes/Wee/SimpleIdGenerator.html +14 -14
- data/doc/rdoc/classes/Wee/Snapshot.html +19 -19
- data/doc/rdoc/classes/Wee/Utils.html +22 -22
- data/doc/rdoc/classes/Wee/Utils/LRUCache.html +6 -6
- data/doc/rdoc/classes/Wee/ValueHolder.html +19 -19
- data/doc/rdoc/classes/Wee/WEBrickAdaptor.html +72 -46
- data/doc/rdoc/classes/Wee/WrapperDecoration.html +6 -6
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/INSTALL.html +1 -1
- data/doc/rdoc/files/README.html +8 -12
- data/doc/rdoc/files/lib/cache/cache_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/abstractsession_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/adaptors/fastcgi_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/adaptors/nitro_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/adaptors/rails_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/adaptors/webrick_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/application_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/components/component_dispatcher_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/components/form_decoration_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/components/login_decoration_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/components/messagebox_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/components/page_decoration_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/components/pager_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/components/wrapper_decoration_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/components_rb.html +4 -1
- data/doc/rdoc/files/lib/wee/continuation/core/component_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/continuation/session_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/continuation_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core/callback_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core/component_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core/componentrunner_rb.html +110 -0
- data/doc/rdoc/files/lib/wee/core/context_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/core/decoration_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core/idgen_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/core/page_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/core/presenter_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core/renderer_rb.html +107 -0
- data/doc/rdoc/files/lib/wee/core/snapshot_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core/valueholder_rb.html +2 -2
- data/doc/rdoc/files/lib/wee/core_ext_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/core_rb.html +7 -14
- data/doc/rdoc/files/lib/wee/databases/og/application_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/databases/og/old_scaffolder_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/databases/og/scaffolder_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/databases/og/session_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/databases/og_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/examples/calculator_rb.html +107 -0
- data/doc/rdoc/files/lib/wee/examples/counter_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/examples/editable_counter_rb.html +114 -0
- data/doc/rdoc/files/lib/wee/examples/window_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/idgen/md5_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/idgen/simple_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/page_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/pageless/application_rb.html +8 -1
- data/doc/rdoc/files/lib/wee/pageless/request_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/pageless/session_rb.html +2 -1
- data/doc/rdoc/files/lib/wee/pageless_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/renderer/html/brushes_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/renderer/html/canvas_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/renderer/html/writer_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/request_rb.html +5 -4
- data/doc/rdoc/files/lib/wee/requesthandler_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/response_rb.html +2 -1
- data/doc/rdoc/files/lib/wee/session_rb.html +2 -3
- data/doc/rdoc/files/lib/wee/skeleton/og/components/main_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/skeleton/og/conf/db_rb.html +2 -2
- data/doc/rdoc/files/lib/wee/skeleton/og/models/recipe_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/skeleton/og/run_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/skeleton/simple/components/main_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/skeleton/simple/run_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/snapshot_ext_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/template_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/utils/autoreload_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/utils/cache_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/utils/helper_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/utils_rb.html +1 -1
- data/doc/rdoc/files/lib/wee_rb.html +5 -3
- data/doc/rdoc/fr_class_index.html +34 -2
- data/doc/rdoc/fr_file_index.html +17 -1
- data/doc/rdoc/fr_method_index.html +464 -314
- data/examples/ajax/ajax.rb +1 -1
- data/examples/demo.rb +47 -0
- data/examples/{calendar.rb → demo/calendar.rb} +89 -97
- data/examples/{example.rb → demo/example.rb} +17 -97
- data/examples/dispatcher.rb +37 -0
- data/examples/draw.rb +14 -11
- data/examples/nitro/run.rb +42 -0
- data/examples/radio.rb +44 -0
- data/examples/test.rb +3 -27
- data/lib/wee.rb +15 -3
- data/lib/wee/adaptors/nitro.rb +154 -0
- data/lib/wee/adaptors/rails.rb +154 -0
- data/lib/wee/application.rb +22 -20
- data/lib/wee/components.rb +3 -0
- data/lib/wee/components/component_dispatcher.rb +46 -0
- data/lib/wee/components/login_decoration.rb +35 -0
- data/lib/wee/components/messagebox.rb +2 -2
- data/lib/wee/components/pager.rb +102 -0
- data/lib/wee/continuation/core/component.rb +13 -12
- data/lib/wee/continuation/session.rb +11 -19
- data/lib/wee/core.rb +8 -7
- data/lib/wee/core/component.rb +8 -28
- data/lib/wee/core/componentrunner.rb +73 -0
- data/lib/wee/core/context.rb +27 -0
- data/lib/wee/core/idgen.rb +5 -0
- data/lib/wee/core/page.rb +1 -0
- data/lib/wee/core/presenter.rb +10 -126
- data/lib/wee/core/renderer.rb +23 -0
- data/lib/wee/core_ext.rb +122 -0
- data/lib/wee/databases/og/scaffolder.rb +0 -1
- data/lib/wee/examples/calculator.rb +70 -0
- data/lib/wee/examples/counter.rb +33 -0
- data/lib/wee/examples/editable_counter.rb +31 -0
- data/{examples → lib/wee/examples}/window.rb +29 -23
- data/lib/wee/idgen/md5.rb +1 -1
- data/lib/wee/idgen/simple.rb +1 -1
- data/lib/wee/pageless/session.rb +2 -3
- data/lib/wee/renderer/html/brushes.rb +142 -22
- data/lib/wee/renderer/html/canvas.rb +57 -19
- data/lib/wee/response.rb +3 -2
- data/lib/wee/session.rb +10 -54
- data/lib/wee/skeleton/og/components/main.rb +5 -1
- data/lib/wee/skeleton/og/conf/db.rb +1 -1
- data/lib/wee/snapshot_ext.rb +4 -10
- data/lib/wee/template.rb +19 -5
- data/lib/wee/utils/helper.rb +2 -2
- metadata +90 -13
- data/examples/calculator.rb +0 -67
- data/lib/wee/context.rb +0 -2
@@ -55,6 +55,10 @@
|
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
+
<a href="../../files/lib/wee/core_ext_rb.html">
|
59
|
+
lib/wee/core_ext.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
58
62
|
<a href="../../files/lib/wee/template_rb.html">
|
59
63
|
lib/wee/template.rb
|
60
64
|
</a>
|
@@ -62,6 +66,14 @@
|
|
62
66
|
<a href="../../files/lib/wee/core/presenter_rb.html">
|
63
67
|
lib/wee/core/presenter.rb
|
64
68
|
</a>
|
69
|
+
<br />
|
70
|
+
<a href="../../files/lib/wee/adaptors/rails_rb.html">
|
71
|
+
lib/wee/adaptors/rails.rb
|
72
|
+
</a>
|
73
|
+
<br />
|
74
|
+
<a href="../../files/lib/wee/adaptors/nitro_rb.html">
|
75
|
+
lib/wee/adaptors/nitro.rb
|
76
|
+
</a>
|
65
77
|
<br />
|
66
78
|
</td>
|
67
79
|
</tr>
|
@@ -99,11 +111,11 @@ important subclasses.
|
|
99
111
|
<div id="contents-list">
|
100
112
|
<h3 class="section-bar">Contents</h3>
|
101
113
|
<ul>
|
102
|
-
<li><a href="#
|
103
|
-
<li><a href="#
|
104
|
-
<li><a href="#
|
105
|
-
<li><a href="#
|
106
|
-
<li><a href="#
|
114
|
+
<li><a href="#SEC00035">Session</a></li>
|
115
|
+
<li><a href="#SEC00036">Properties</a></li>
|
116
|
+
<li><a href="#SEC00105">Render</a></li>
|
117
|
+
<li><a href="#SEC00106">Callback</a></li>
|
118
|
+
<li><a href="#SEC00107">Backtrack</a></li>
|
107
119
|
</ul>
|
108
120
|
</div>
|
109
121
|
|
@@ -111,19 +123,26 @@ important subclasses.
|
|
111
123
|
<h3 class="section-bar">Methods</h3>
|
112
124
|
|
113
125
|
<div class="name-list">
|
114
|
-
<a href="#
|
115
|
-
<a href="#
|
116
|
-
<a href="#
|
117
|
-
<a href="#
|
118
|
-
<a href="#
|
119
|
-
<a href="#
|
120
|
-
<a href="#
|
121
|
-
<a href="#
|
122
|
-
<a href="#
|
123
|
-
<a href="#
|
124
|
-
<a href="#
|
125
|
-
<a href="#
|
126
|
-
<a href="#
|
126
|
+
<a href="#M000381">backtrack_state</a>
|
127
|
+
<a href="#M000375">do_render</a>
|
128
|
+
<a href="#M000370">get_property</a>
|
129
|
+
<a href="#M000371">lookup_property</a>
|
130
|
+
<a href="#M000380">process_callbacks</a>
|
131
|
+
<a href="#M000368">properties</a>
|
132
|
+
<a href="#M000369">properties=</a>
|
133
|
+
<a href="#M000377">r</a>
|
134
|
+
<a href="#M000374">render</a>
|
135
|
+
<a href="#M000376">renderer</a>
|
136
|
+
<a href="#M000364">renderer_class</a>
|
137
|
+
<a href="#M000383">renderer_class</a>
|
138
|
+
<a href="#M000382">renderer_class</a>
|
139
|
+
<a href="#M000379">renderer_class</a>
|
140
|
+
<a href="#M000367">send_render_response</a>
|
141
|
+
<a href="#M000366">send_response</a>
|
142
|
+
<a href="#M000365">session</a>
|
143
|
+
<a href="#M000373">template</a>
|
144
|
+
<a href="#M000372">uses_property</a>
|
145
|
+
<a href="#M000378">with_renderer_for</a>
|
127
146
|
</div>
|
128
147
|
</div>
|
129
148
|
|
@@ -141,23 +160,182 @@ important subclasses.
|
|
141
160
|
|
142
161
|
|
143
162
|
|
163
|
+
<!-- if method_list -->
|
164
|
+
<div id="methods">
|
165
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
166
|
+
|
167
|
+
<div id="method-M000364" class="method-detail">
|
168
|
+
<a name="M000364"></a>
|
169
|
+
|
170
|
+
<div class="method-heading">
|
171
|
+
<a href="#M000364" class="method-signature">
|
172
|
+
<span class="method-name">renderer_class</span><span class="method-args">()</span>
|
173
|
+
</a>
|
174
|
+
</div>
|
175
|
+
|
176
|
+
<div class="method-description">
|
177
|
+
<p><a class="source-toggle" href="#"
|
178
|
+
onclick="toggleCode('M000364-source');return false;">[Source]</a></p>
|
179
|
+
<div class="method-source-code" id="M000364-source">
|
180
|
+
<pre>
|
181
|
+
<span class="ruby-comment cmt"># File lib/wee/core_ext.rb, line 3</span>
|
182
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">renderer_class</span>
|
183
|
+
<span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">DefaultRenderer</span>
|
184
|
+
<span class="ruby-keyword kw">end</span>
|
185
|
+
</pre>
|
186
|
+
</div>
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
|
190
|
+
|
191
|
+
</div>
|
192
|
+
<div id="section">
|
193
|
+
<h2 class="section-title"><a name="SEC00035">Session</a></h2>
|
194
|
+
<div class="section-comment">
|
195
|
+
|
196
|
+
</div>
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
<!-- if method_list -->
|
206
|
+
<div id="methods">
|
207
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
208
|
+
|
209
|
+
<div id="method-M000365" class="method-detail">
|
210
|
+
<a name="M000365"></a>
|
211
|
+
|
212
|
+
<div class="method-heading">
|
213
|
+
<a href="#M000365" class="method-signature">
|
214
|
+
<span class="method-name">session</span><span class="method-args">()</span>
|
215
|
+
</a>
|
216
|
+
</div>
|
217
|
+
|
218
|
+
<div class="method-description">
|
219
|
+
<p>
|
220
|
+
Returns the current session. A presenter (or component) has always an
|
221
|
+
associated session. The returned object is of class <a
|
222
|
+
href="Session.html">Wee::Session</a> or a subclass thereof.
|
223
|
+
</p>
|
224
|
+
<p><a class="source-toggle" href="#"
|
225
|
+
onclick="toggleCode('M000365-source');return false;">[Source]</a></p>
|
226
|
+
<div class="method-source-code" id="M000365-source">
|
227
|
+
<pre>
|
228
|
+
<span class="ruby-comment cmt"># File lib/wee/core_ext.rb, line 17</span>
|
229
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">session</span>
|
230
|
+
<span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">Session</span>.<span class="ruby-identifier">current</span>
|
231
|
+
<span class="ruby-keyword kw">end</span>
|
232
|
+
</pre>
|
233
|
+
</div>
|
234
|
+
</div>
|
235
|
+
</div>
|
236
|
+
|
237
|
+
<h3 class="section-bar">Protected Instance methods</h3>
|
238
|
+
|
239
|
+
<div id="method-M000367" class="method-detail">
|
240
|
+
<a name="M000367"></a>
|
241
|
+
|
242
|
+
<div class="method-heading">
|
243
|
+
<a href="#M000367" class="method-signature">
|
244
|
+
<span class="method-name">send_render_response</span><span class="method-args">(&block)</span>
|
245
|
+
</a>
|
246
|
+
</div>
|
247
|
+
|
248
|
+
<div class="method-description">
|
249
|
+
<p>
|
250
|
+
Call the block inside a rendering environment, then send the response
|
251
|
+
prematurely.
|
252
|
+
</p>
|
253
|
+
<p><a class="source-toggle" href="#"
|
254
|
+
onclick="toggleCode('M000367-source');return false;">[Source]</a></p>
|
255
|
+
<div class="method-source-code" id="M000367-source">
|
256
|
+
<pre>
|
257
|
+
<span class="ruby-comment cmt"># File lib/wee/core_ext.rb, line 31</span>
|
258
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_render_response</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
259
|
+
<span class="ruby-comment cmt"># Generate a response</span>
|
260
|
+
<span class="ruby-identifier">response</span> = <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">GenericResponse</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">'text/html'</span>, <span class="ruby-value str">''</span>)
|
261
|
+
|
262
|
+
<span class="ruby-comment cmt"># Get the current context we are in</span>
|
263
|
+
<span class="ruby-identifier">context</span> = <span class="ruby-identifier">session</span>.<span class="ruby-identifier">current_context</span>
|
264
|
+
|
265
|
+
<span class="ruby-comment cmt"># A rendering context is needed to use 'r' (if you want, you can simply</span>
|
266
|
+
<span class="ruby-comment cmt"># omit this and just return the response with some html/xml filled in.</span>
|
267
|
+
<span class="ruby-identifier">rendering_context</span> = <span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">RenderingContext</span>.<span class="ruby-identifier">new</span>(
|
268
|
+
<span class="ruby-identifier">context</span>,
|
269
|
+
<span class="ruby-identifier">session</span>.<span class="ruby-identifier">current_callbacks</span>,
|
270
|
+
<span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">HtmlWriter</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">response</span>.<span class="ruby-identifier">content</span>))
|
271
|
+
|
272
|
+
<span class="ruby-identifier">with_renderer_for</span>(<span class="ruby-identifier">rendering_context</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
273
|
+
|
274
|
+
<span class="ruby-identifier">send_response</span>(<span class="ruby-identifier">response</span>)
|
275
|
+
<span class="ruby-keyword kw">end</span>
|
276
|
+
</pre>
|
277
|
+
</div>
|
278
|
+
</div>
|
279
|
+
</div>
|
280
|
+
|
281
|
+
<div id="method-M000366" class="method-detail">
|
282
|
+
<a name="M000366"></a>
|
283
|
+
|
284
|
+
<div class="method-heading">
|
285
|
+
<a href="#M000366" class="method-signature">
|
286
|
+
<span class="method-name">send_response</span><span class="method-args">(response)</span>
|
287
|
+
</a>
|
288
|
+
</div>
|
289
|
+
|
290
|
+
<div class="method-description">
|
291
|
+
<p>
|
292
|
+
Send a premature response.
|
293
|
+
</p>
|
294
|
+
<p><a class="source-toggle" href="#"
|
295
|
+
onclick="toggleCode('M000366-source');return false;">[Source]</a></p>
|
296
|
+
<div class="method-source-code" id="M000366-source">
|
297
|
+
<pre>
|
298
|
+
<span class="ruby-comment cmt"># File lib/wee/core_ext.rb, line 25</span>
|
299
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">send_response</span>(<span class="ruby-identifier">response</span>)
|
300
|
+
<span class="ruby-identifier">throw</span> <span class="ruby-identifier">:wee_abort_callback_processing</span>, <span class="ruby-identifier">response</span>
|
301
|
+
<span class="ruby-keyword kw">end</span>
|
302
|
+
</pre>
|
303
|
+
</div>
|
304
|
+
</div>
|
305
|
+
</div>
|
306
|
+
|
307
|
+
|
308
|
+
</div>
|
309
|
+
<div id="section">
|
310
|
+
<h2 class="section-title"><a name="SEC00036">Properties</a></h2>
|
311
|
+
<div class="section-comment">
|
312
|
+
|
313
|
+
</div>
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
|
144
322
|
<!-- if method_list -->
|
145
323
|
<div id="methods">
|
146
324
|
<h3 class="section-bar">Public Class methods</h3>
|
147
325
|
|
148
|
-
<div id="method-
|
149
|
-
<a name="
|
326
|
+
<div id="method-M000373" class="method-detail">
|
327
|
+
<a name="M000373"></a>
|
150
328
|
|
151
329
|
<div class="method-heading">
|
152
|
-
<a href="#
|
330
|
+
<a href="#M000373" class="method-signature">
|
153
331
|
<span class="method-name">template</span><span class="method-args">(method, hash={})</span>
|
154
332
|
</a>
|
155
333
|
</div>
|
156
334
|
|
157
335
|
<div class="method-description">
|
158
336
|
<p><a class="source-toggle" href="#"
|
159
|
-
onclick="toggleCode('
|
160
|
-
<div class="method-source-code" id="
|
337
|
+
onclick="toggleCode('M000373-source');return false;">[Source]</a></p>
|
338
|
+
<div class="method-source-code" id="M000373-source">
|
161
339
|
<pre>
|
162
340
|
<span class="ruby-comment cmt"># File lib/wee/template.rb, line 2</span>
|
163
341
|
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">template</span>(<span class="ruby-identifier">method</span>, <span class="ruby-identifier">hash</span>={})
|
@@ -168,6 +346,12 @@ important subclasses.
|
|
168
346
|
<span class="ruby-node">"lookup_property(#{ hash[:property].inspect })"</span>
|
169
347
|
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">:file</span>)
|
170
348
|
<span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:file</span>].<span class="ruby-identifier">inspect</span>
|
349
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">hash</span>.<span class="ruby-identifier">has_key?</span>(<span class="ruby-identifier">:local</span>)
|
350
|
+
<span class="ruby-comment cmt"># like file, but use relative to current path</span>
|
351
|
+
|
352
|
+
<span class="ruby-identifier">caller_path</span> = <span class="ruby-identifier">caller</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/:\d+$/</span>, <span class="ruby-value str">""</span>)
|
353
|
+
|
354
|
+
<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">caller_path</span>), <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:local</span>]).<span class="ruby-identifier">inspect</span>
|
171
355
|
<span class="ruby-keyword kw">else</span>
|
172
356
|
<span class="ruby-identifier">caller_path</span> = <span class="ruby-identifier">caller</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/:\d+$/</span>, <span class="ruby-value str">""</span>)
|
173
357
|
<span class="ruby-identifier">basename</span> = <span class="ruby-identifier">caller_path</span>[<span class="ruby-value">0</span>, <span class="ruby-identifier">caller_path</span>.<span class="ruby-identifier">rindex</span>(<span class="ruby-value str">".rb"</span>)]
|
@@ -180,21 +364,203 @@ important subclasses.
|
|
180
364
|
<span class="ruby-keyword kw">end</span>.<span class="ruby-identifier">inspect</span>
|
181
365
|
<span class="ruby-keyword kw">end</span>
|
182
366
|
|
183
|
-
<span class="ruby-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
367
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">hash</span>[<span class="ruby-identifier">:r_as_param</span>]
|
368
|
+
<span class="ruby-identifier">class_eval</span> <span class="ruby-node">%{
|
369
|
+
def #{ method }(r)
|
370
|
+
r.template(#{ file_code })
|
371
|
+
end
|
372
|
+
}</span>
|
373
|
+
<span class="ruby-keyword kw">else</span>
|
374
|
+
<span class="ruby-identifier">class_eval</span> <span class="ruby-node">%{
|
375
|
+
def #{ method }
|
376
|
+
r.template(#{ file_code })
|
377
|
+
end
|
378
|
+
}</span>
|
379
|
+
<span class="ruby-keyword kw">end</span>
|
380
|
+
<span class="ruby-keyword kw">end</span>
|
381
|
+
</pre>
|
382
|
+
</div>
|
383
|
+
</div>
|
384
|
+
</div>
|
385
|
+
|
386
|
+
<div id="method-M000372" class="method-detail">
|
387
|
+
<a name="M000372"></a>
|
388
|
+
|
389
|
+
<div class="method-heading">
|
390
|
+
<a href="#M000372" class="method-signature">
|
391
|
+
<span class="method-name">uses_property</span><span class="method-args">(*args)</span>
|
392
|
+
</a>
|
393
|
+
</div>
|
394
|
+
|
395
|
+
<div class="method-description">
|
396
|
+
<p>
|
397
|
+
This is currently only used for describing which properties are required by
|
398
|
+
the underlying component.
|
399
|
+
</p>
|
400
|
+
<p><a class="source-toggle" href="#"
|
401
|
+
onclick="toggleCode('M000372-source');return false;">[Source]</a></p>
|
402
|
+
<div class="method-source-code" id="M000372-source">
|
403
|
+
<pre>
|
404
|
+
<span class="ruby-comment cmt"># File lib/wee/core_ext.rb, line 119</span>
|
405
|
+
<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>)
|
188
406
|
<span class="ruby-keyword kw">end</span>
|
189
407
|
</pre>
|
190
408
|
</div>
|
191
409
|
</div>
|
192
410
|
</div>
|
193
411
|
|
412
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
413
|
+
|
414
|
+
<div id="method-M000370" class="method-detail">
|
415
|
+
<a name="M000370"></a>
|
416
|
+
|
417
|
+
<div class="method-heading">
|
418
|
+
<a href="#M000370" class="method-signature">
|
419
|
+
<span class="method-name">get_property</span><span class="method-args">(prop)</span>
|
420
|
+
</a>
|
421
|
+
</div>
|
422
|
+
|
423
|
+
<div class="method-description">
|
424
|
+
<p>
|
425
|
+
Returns an "owned" property.
|
426
|
+
</p>
|
427
|
+
<p><a class="source-toggle" href="#"
|
428
|
+
onclick="toggleCode('M000370-source');return false;">[Source]</a></p>
|
429
|
+
<div class="method-source-code" id="M000370-source">
|
430
|
+
<pre>
|
431
|
+
<span class="ruby-comment cmt"># File lib/wee/core_ext.rb, line 62</span>
|
432
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_property</span>(<span class="ruby-identifier">prop</span>)
|
433
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">properties</span>
|
434
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">properties</span>[<span class="ruby-identifier">prop</span>]
|
435
|
+
<span class="ruby-keyword kw">else</span>
|
436
|
+
<span class="ruby-keyword kw">nil</span>
|
437
|
+
<span class="ruby-keyword kw">end</span>
|
438
|
+
<span class="ruby-keyword kw">end</span>
|
439
|
+
</pre>
|
440
|
+
</div>
|
441
|
+
</div>
|
442
|
+
</div>
|
443
|
+
|
444
|
+
<div id="method-M000371" class="method-detail">
|
445
|
+
<a name="M000371"></a>
|
446
|
+
|
447
|
+
<div class="method-heading">
|
448
|
+
<a href="#M000371" class="method-signature">
|
449
|
+
<span class="method-name">lookup_property</span><span class="method-args">(prop)</span>
|
450
|
+
</a>
|
451
|
+
</div>
|
452
|
+
|
453
|
+
<div class="method-description">
|
454
|
+
<p>
|
455
|
+
Tries to lookup a property from different places. <tt>nil</tt> as property
|
456
|
+
value is not allowed!
|
457
|
+
</p>
|
458
|
+
<p>
|
459
|
+
Search order:
|
460
|
+
</p>
|
461
|
+
<ol>
|
462
|
+
<li>self.get_property(prop)
|
463
|
+
|
464
|
+
</li>
|
465
|
+
<li>session.get_property(prop, self.class)
|
466
|
+
|
467
|
+
</li>
|
468
|
+
<li>application.get_property(prop, self.class)
|
469
|
+
|
470
|
+
</li>
|
471
|
+
<li>session.get_property(prop, nil)
|
472
|
+
|
473
|
+
</li>
|
474
|
+
<li>application.get_property(prop, nil)
|
475
|
+
|
476
|
+
</li>
|
477
|
+
<li>@@properties[prop]
|
478
|
+
|
479
|
+
</li>
|
480
|
+
</ol>
|
481
|
+
<p><a class="source-toggle" href="#"
|
482
|
+
onclick="toggleCode('M000371-source');return false;">[Source]</a></p>
|
483
|
+
<div class="method-source-code" id="M000371-source">
|
484
|
+
<pre>
|
485
|
+
<span class="ruby-comment cmt"># File lib/wee/core_ext.rb, line 88</span>
|
486
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">lookup_property</span>(<span class="ruby-identifier">prop</span>)
|
487
|
+
<span class="ruby-identifier">val</span> = <span class="ruby-identifier">get_property</span>(<span class="ruby-identifier">prop</span>)
|
488
|
+
<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>
|
489
|
+
|
490
|
+
<span class="ruby-identifier">sess</span> = <span class="ruby-identifier">session</span>()
|
491
|
+
<span class="ruby-identifier">app</span> = <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">application</span>
|
492
|
+
<span class="ruby-identifier">klass</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>
|
493
|
+
|
494
|
+
<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>)
|
495
|
+
<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>
|
496
|
+
|
497
|
+
<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>)
|
498
|
+
<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>
|
499
|
+
|
500
|
+
<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>)
|
501
|
+
<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>
|
502
|
+
|
503
|
+
<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>)
|
504
|
+
<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>
|
505
|
+
|
506
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-ivar">@@properties</span>)
|
507
|
+
<span class="ruby-identifier">val</span> = <span class="ruby-ivar">@@properties</span>[<span class="ruby-identifier">prop</span>]
|
508
|
+
<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>
|
509
|
+
<span class="ruby-keyword kw">end</span>
|
510
|
+
|
511
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
512
|
+
<span class="ruby-keyword kw">end</span>
|
513
|
+
</pre>
|
514
|
+
</div>
|
515
|
+
</div>
|
516
|
+
</div>
|
517
|
+
|
518
|
+
<div id="method-M000368" class="method-detail">
|
519
|
+
<a name="M000368"></a>
|
520
|
+
|
521
|
+
<div class="method-heading">
|
522
|
+
<a href="#M000368" class="method-signature">
|
523
|
+
<span class="method-name">properties</span><span class="method-args">()</span>
|
524
|
+
</a>
|
525
|
+
</div>
|
526
|
+
|
527
|
+
<div class="method-description">
|
528
|
+
<p><a class="source-toggle" href="#"
|
529
|
+
onclick="toggleCode('M000368-source');return false;">[Source]</a></p>
|
530
|
+
<div class="method-source-code" id="M000368-source">
|
531
|
+
<pre>
|
532
|
+
<span class="ruby-comment cmt"># File lib/wee/core_ext.rb, line 57</span>
|
533
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">properties</span>() <span class="ruby-ivar">@__properties</span> <span class="ruby-keyword kw">end</span>
|
534
|
+
</pre>
|
535
|
+
</div>
|
536
|
+
</div>
|
537
|
+
</div>
|
538
|
+
|
539
|
+
<div id="method-M000369" class="method-detail">
|
540
|
+
<a name="M000369"></a>
|
541
|
+
|
542
|
+
<div class="method-heading">
|
543
|
+
<a href="#M000369" class="method-signature">
|
544
|
+
<span class="method-name">properties=</span><span class="method-args">(props)</span>
|
545
|
+
</a>
|
546
|
+
</div>
|
547
|
+
|
548
|
+
<div class="method-description">
|
549
|
+
<p><a class="source-toggle" href="#"
|
550
|
+
onclick="toggleCode('M000369-source');return false;">[Source]</a></p>
|
551
|
+
<div class="method-source-code" id="M000369-source">
|
552
|
+
<pre>
|
553
|
+
<span class="ruby-comment cmt"># File lib/wee/core_ext.rb, line 58</span>
|
554
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">properties=</span>(<span class="ruby-identifier">props</span>) <span class="ruby-ivar">@__properties</span> = <span class="ruby-identifier">props</span> <span class="ruby-keyword kw">end</span>
|
555
|
+
</pre>
|
556
|
+
</div>
|
557
|
+
</div>
|
558
|
+
</div>
|
559
|
+
|
194
560
|
|
195
561
|
</div>
|
196
562
|
<div id="section">
|
197
|
-
<h2 class="section-title"><a name="
|
563
|
+
<h2 class="section-title"><a name="SEC00105">Render</a></h2>
|
198
564
|
<div class="section-comment">
|
199
565
|
|
200
566
|
</div>
|
@@ -210,11 +576,11 @@ important subclasses.
|
|
210
576
|
<div id="methods">
|
211
577
|
<h3 class="section-bar">Public Instance methods</h3>
|
212
578
|
|
213
|
-
<div id="method-
|
214
|
-
<a name="
|
579
|
+
<div id="method-M000375" class="method-detail">
|
580
|
+
<a name="M000375"></a>
|
215
581
|
|
216
582
|
<div class="method-heading">
|
217
|
-
<a href="#
|
583
|
+
<a href="#M000375" class="method-signature">
|
218
584
|
<span class="method-name">do_render</span><span class="method-args">(rendering_context)</span>
|
219
585
|
</a>
|
220
586
|
</div>
|
@@ -226,8 +592,8 @@ overwrite this method, unless you know exactly what you’re doing!
|
|
226
592
|
</p>
|
227
593
|
<p>
|
228
594
|
Creates a new renderer object of the class returned by method <a
|
229
|
-
href="Presenter.html#
|
230
|
-
renderer, then invokes method <a href="Presenter.html#
|
595
|
+
href="Presenter.html#M000364">renderer_class</a>, makes this the current
|
596
|
+
renderer, then invokes method <a href="Presenter.html#M000374">render</a>.
|
231
597
|
</p>
|
232
598
|
<dl>
|
233
599
|
<dt><tt>rendering_context</tt></dt><dd>An object of class <a href="RenderingContext.html">RenderingContext</a>
|
@@ -235,8 +601,8 @@ renderer, then invokes method <a href="Presenter.html#M000287">render</a>.
|
|
235
601
|
</dd>
|
236
602
|
</dl>
|
237
603
|
<p><a class="source-toggle" href="#"
|
238
|
-
onclick="toggleCode('
|
239
|
-
<div class="method-source-code" id="
|
604
|
+
onclick="toggleCode('M000375-source');return false;">[Source]</a></p>
|
605
|
+
<div class="method-source-code" id="M000375-source">
|
240
606
|
<pre>
|
241
607
|
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 33</span>
|
242
608
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">do_render</span>(<span class="ruby-identifier">rendering_context</span>)
|
@@ -247,11 +613,11 @@ renderer, then invokes method <a href="Presenter.html#M000287">render</a>.
|
|
247
613
|
</div>
|
248
614
|
</div>
|
249
615
|
|
250
|
-
<div id="method-
|
251
|
-
<a name="
|
616
|
+
<div id="method-M000374" class="method-detail">
|
617
|
+
<a name="M000374"></a>
|
252
618
|
|
253
619
|
<div class="method-heading">
|
254
|
-
<a href="#
|
620
|
+
<a href="#M000374" class="method-signature">
|
255
621
|
<span class="method-name">render</span><span class="method-args">()</span>
|
256
622
|
</a>
|
257
623
|
</div>
|
@@ -266,12 +632,12 @@ view. By default this method does nothing!
|
|
266
632
|
</p>
|
267
633
|
<p>
|
268
634
|
Use the current renderer as returned by <a
|
269
|
-
href="Presenter.html#
|
270
|
-
href="Presenter.html#
|
635
|
+
href="Presenter.html#M000376">renderer</a> or it’s short-cut <a
|
636
|
+
href="Presenter.html#M000377">r</a>.
|
271
637
|
</p>
|
272
638
|
<p><a class="source-toggle" href="#"
|
273
|
-
onclick="toggleCode('
|
274
|
-
<div class="method-source-code" id="
|
639
|
+
onclick="toggleCode('M000374-source');return false;">[Source]</a></p>
|
640
|
+
<div class="method-source-code" id="M000374-source">
|
275
641
|
<pre>
|
276
642
|
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 20</span>
|
277
643
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render</span>
|
@@ -283,35 +649,35 @@ href="Presenter.html#M000290">r</a>.
|
|
283
649
|
|
284
650
|
<h3 class="section-bar">Protected Instance methods</h3>
|
285
651
|
|
286
|
-
<div id="method-
|
287
|
-
<a name="
|
652
|
+
<div id="method-M000377" class="method-detail">
|
653
|
+
<a name="M000377"></a>
|
288
654
|
|
289
655
|
<div class="method-heading">
|
290
|
-
<a href="#
|
656
|
+
<a href="#M000377" class="method-signature">
|
291
657
|
<span class="method-name">r</span><span class="method-args">()</span>
|
292
658
|
</a>
|
293
659
|
</div>
|
294
660
|
|
295
661
|
<div class="method-description">
|
296
662
|
<p>
|
297
|
-
Short cut for <a href="Presenter.html#
|
663
|
+
Short cut for <a href="Presenter.html#M000376">renderer</a>.
|
298
664
|
</p>
|
299
665
|
<p><a class="source-toggle" href="#"
|
300
|
-
onclick="toggleCode('
|
301
|
-
<div class="method-source-code" id="
|
666
|
+
onclick="toggleCode('M000377-source');return false;">[Source]</a></p>
|
667
|
+
<div class="method-source-code" id="M000377-source">
|
302
668
|
<pre>
|
303
669
|
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 43</span>
|
304
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">r</span>() <span class="ruby-ivar">@
|
670
|
+
<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>
|
305
671
|
</pre>
|
306
672
|
</div>
|
307
673
|
</div>
|
308
674
|
</div>
|
309
675
|
|
310
|
-
<div id="method-
|
311
|
-
<a name="
|
676
|
+
<div id="method-M000376" class="method-detail">
|
677
|
+
<a name="M000376"></a>
|
312
678
|
|
313
679
|
<div class="method-heading">
|
314
|
-
<a href="#
|
680
|
+
<a href="#M000376" class="method-signature">
|
315
681
|
<span class="method-name">renderer</span><span class="method-args">()</span>
|
316
682
|
</a>
|
317
683
|
</div>
|
@@ -321,21 +687,21 @@ Short cut for <a href="Presenter.html#M000289">renderer</a>.
|
|
321
687
|
Returns the current renderer object for use by the render methods.
|
322
688
|
</p>
|
323
689
|
<p><a class="source-toggle" href="#"
|
324
|
-
onclick="toggleCode('
|
325
|
-
<div class="method-source-code" id="
|
690
|
+
onclick="toggleCode('M000376-source');return false;">[Source]</a></p>
|
691
|
+
<div class="method-source-code" id="M000376-source">
|
326
692
|
<pre>
|
327
693
|
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 40</span>
|
328
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">renderer</span>() <span class="ruby-ivar">@
|
694
|
+
<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>
|
329
695
|
</pre>
|
330
696
|
</div>
|
331
697
|
</div>
|
332
698
|
</div>
|
333
699
|
|
334
|
-
<div id="method-
|
335
|
-
<a name="
|
700
|
+
<div id="method-M000379" class="method-detail">
|
701
|
+
<a name="M000379"></a>
|
336
702
|
|
337
703
|
<div class="method-heading">
|
338
|
-
<a href="#
|
704
|
+
<a href="#M000379" class="method-signature">
|
339
705
|
<span class="method-name">renderer_class</span><span class="method-args">()</span>
|
340
706
|
</a>
|
341
707
|
</div>
|
@@ -344,25 +710,32 @@ Returns the current renderer object for use by the render methods.
|
|
344
710
|
<p>
|
345
711
|
Returns the class used as renderer for this presenter. Overwrite this
|
346
712
|
method if you want to use a different renderer.
|
713
|
+
</p>
|
714
|
+
<p>
|
715
|
+
Returned class must be a subclass of <a
|
716
|
+
href="Renderer.html">Wee::Renderer</a>.
|
717
|
+
</p>
|
718
|
+
<p>
|
719
|
+
NEEDS TO BE OVERWRITTEN by some non-core files.
|
347
720
|
</p>
|
348
721
|
<p><a class="source-toggle" href="#"
|
349
|
-
onclick="toggleCode('
|
350
|
-
<div class="method-source-code" id="
|
722
|
+
onclick="toggleCode('M000379-source');return false;">[Source]</a></p>
|
723
|
+
<div class="method-source-code" id="M000379-source">
|
351
724
|
<pre>
|
352
725
|
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 66</span>
|
353
726
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">renderer_class</span>
|
354
|
-
<span class="ruby-
|
727
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"Method renderer_class needs to be implemented!"</span>
|
355
728
|
<span class="ruby-keyword kw">end</span>
|
356
729
|
</pre>
|
357
730
|
</div>
|
358
731
|
</div>
|
359
732
|
</div>
|
360
733
|
|
361
|
-
<div id="method-
|
362
|
-
<a name="
|
734
|
+
<div id="method-M000378" class="method-detail">
|
735
|
+
<a name="M000378"></a>
|
363
736
|
|
364
737
|
<div class="method-heading">
|
365
|
-
<a href="#
|
738
|
+
<a href="#M000378" class="method-signature">
|
366
739
|
<span class="method-name">with_renderer_for</span><span class="method-args">(rendering_context) {|| ...}</span>
|
367
740
|
</a>
|
368
741
|
</div>
|
@@ -370,26 +743,22 @@ method if you want to use a different renderer.
|
|
370
743
|
<div class="method-description">
|
371
744
|
<p>
|
372
745
|
Creates a new renderer object of the class returned by method <a
|
373
|
-
href="Presenter.html#
|
746
|
+
href="Presenter.html#M000364">renderer_class</a>, then makes this the
|
374
747
|
current renderer for the time the block it yields to executes. Finally, it
|
375
748
|
restores the current renderer to the former one and closes the newly
|
376
749
|
created renderer.
|
377
750
|
</p>
|
378
751
|
<p><a class="source-toggle" href="#"
|
379
|
-
onclick="toggleCode('
|
380
|
-
<div class="method-source-code" id="
|
752
|
+
onclick="toggleCode('M000378-source');return false;">[Source]</a></p>
|
753
|
+
<div class="method-source-code" id="M000378-source">
|
381
754
|
<pre>
|
382
755
|
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 50</span>
|
383
756
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with_renderer_for</span>(<span class="ruby-identifier">rendering_context</span>)
|
384
|
-
<span class="ruby-identifier">
|
385
|
-
<span class="ruby-identifier">renderer</span>.<span class="ruby-identifier">current_component</span> = <span class="ruby-keyword kw">self</span>
|
386
|
-
<span class="ruby-identifier">old_renderer</span> = <span class="ruby-ivar">@renderer</span>
|
757
|
+
<span class="ruby-identifier">old_renderer</span> = <span class="ruby-ivar">@__renderer</span>
|
387
758
|
<span class="ruby-keyword kw">begin</span>
|
388
|
-
<span class="ruby-ivar">@
|
389
|
-
<span class="ruby-keyword kw">yield</span>
|
759
|
+
<span class="ruby-identifier">renderer_class</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">rendering_context</span>, <span class="ruby-keyword kw">self</span>) {<span class="ruby-operator">|</span><span class="ruby-ivar">@__renderer</span><span class="ruby-operator">|</span> <span class="ruby-keyword kw">yield</span> }
|
390
760
|
<span class="ruby-keyword kw">ensure</span>
|
391
|
-
<span class="ruby-ivar">@
|
392
|
-
<span class="ruby-identifier">renderer</span>.<span class="ruby-identifier">close</span> <span class="ruby-comment cmt"># write outstanding brushes to the document</span>
|
761
|
+
<span class="ruby-ivar">@__renderer</span> = <span class="ruby-identifier">old_renderer</span>
|
393
762
|
<span class="ruby-keyword kw">end</span>
|
394
763
|
<span class="ruby-keyword kw">end</span>
|
395
764
|
</pre>
|
@@ -400,7 +769,7 @@ created renderer.
|
|
400
769
|
|
401
770
|
</div>
|
402
771
|
<div id="section">
|
403
|
-
<h2 class="section-title"><a name="
|
772
|
+
<h2 class="section-title"><a name="SEC00106">Callback</a></h2>
|
404
773
|
<div class="section-comment">
|
405
774
|
|
406
775
|
</div>
|
@@ -416,12 +785,12 @@ created renderer.
|
|
416
785
|
<div id="methods">
|
417
786
|
<h3 class="section-bar">Public Instance methods</h3>
|
418
787
|
|
419
|
-
<div id="method-
|
420
|
-
<a name="
|
788
|
+
<div id="method-M000380" class="method-detail">
|
789
|
+
<a name="M000380"></a>
|
421
790
|
|
422
791
|
<div class="method-heading">
|
423
|
-
<a href="#
|
424
|
-
<span class="method-name">process_callbacks</span><span class="method-args">(
|
792
|
+
<a href="#M000380" class="method-signature">
|
793
|
+
<span class="method-name">process_callbacks</span><span class="method-args">(&block)</span>
|
425
794
|
</a>
|
426
795
|
</div>
|
427
796
|
|
@@ -429,39 +798,19 @@ created renderer.
|
|
429
798
|
<p>
|
430
799
|
Process all callbacks specified for this presenter.
|
431
800
|
</p>
|
432
|
-
<p>
|
433
|
-
At first, this method invokes all input callbacks of this presenter, then
|
434
|
-
it calls the block if one was given (used by subclasses). Finally, the
|
435
|
-
action callback is invoked (there’s only one per request).
|
436
|
-
</p>
|
437
|
-
<p>
|
438
|
-
NOTE: Input callbacks should never call other components!
|
439
|
-
</p>
|
440
801
|
<dl>
|
441
|
-
<dt><tt>
|
802
|
+
<dt><tt>block</tt></dt><dd>Specifies the action to be taken (e.g. whether to invoke input or action
|
803
|
+
callbacks).
|
442
804
|
|
443
805
|
</dd>
|
444
806
|
</dl>
|
445
807
|
<p><a class="source-toggle" href="#"
|
446
|
-
onclick="toggleCode('
|
447
|
-
<div class="method-source-code" id="
|
808
|
+
onclick="toggleCode('M000380-source');return false;">[Source]</a></p>
|
809
|
+
<div class="method-source-code" id="M000380-source">
|
448
810
|
<pre>
|
449
|
-
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line
|
450
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_callbacks</span>(<span class="ruby-
|
451
|
-
<span class="ruby-
|
452
|
-
<span class="ruby-identifier">callback_stream</span>.<span class="ruby-identifier">with_callbacks_for</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">:input</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">callback</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
453
|
-
<span class="ruby-identifier">callback</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">value</span>)
|
454
|
-
}
|
455
|
-
|
456
|
-
<span class="ruby-comment cmt"># enable subclasses to add behaviour, e.g. a Component class will invoke</span>
|
457
|
-
<span class="ruby-comment cmt"># process_callbacks_chain for each child in the block.</span>
|
458
|
-
<span class="ruby-keyword kw">yield</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
|
459
|
-
|
460
|
-
<span class="ruby-comment cmt"># invoke action callback. only the first action callback is invoked.</span>
|
461
|
-
<span class="ruby-identifier">callback_stream</span>.<span class="ruby-identifier">with_callbacks_for</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">:action</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">callback</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
|
462
|
-
<span class="ruby-identifier">callback</span>.<span class="ruby-identifier">call</span>
|
463
|
-
<span class="ruby-identifier">throw</span> <span class="ruby-identifier">:wee_back_to_session</span>
|
464
|
-
}
|
811
|
+
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 82</span>
|
812
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">process_callbacks</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
813
|
+
<span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-keyword kw">self</span>)
|
465
814
|
<span class="ruby-keyword kw">end</span>
|
466
815
|
</pre>
|
467
816
|
</div>
|
@@ -471,7 +820,7 @@ NOTE: Input callbacks should never call other components!
|
|
471
820
|
|
472
821
|
</div>
|
473
822
|
<div id="section">
|
474
|
-
<h2 class="section-title"><a name="
|
823
|
+
<h2 class="section-title"><a name="SEC00107">Backtrack</a></h2>
|
475
824
|
<div class="section-comment">
|
476
825
|
|
477
826
|
</div>
|
@@ -487,11 +836,11 @@ NOTE: Input callbacks should never call other components!
|
|
487
836
|
<div id="methods">
|
488
837
|
<h3 class="section-bar">Public Instance methods</h3>
|
489
838
|
|
490
|
-
<div id="method-
|
491
|
-
<a name="
|
839
|
+
<div id="method-M000381" class="method-detail">
|
840
|
+
<a name="M000381"></a>
|
492
841
|
|
493
842
|
<div class="method-heading">
|
494
|
-
<a href="#
|
843
|
+
<a href="#M000381" class="method-signature">
|
495
844
|
<span class="method-name">backtrack_state</span><span class="method-args">(snapshot)</span>
|
496
845
|
</a>
|
497
846
|
</div>
|
@@ -499,7 +848,7 @@ NOTE: Input callbacks should never call other components!
|
|
499
848
|
<div class="method-description">
|
500
849
|
<p>
|
501
850
|
Dummy implementation. See <a
|
502
|
-
href="Component.html#
|
851
|
+
href="Component.html#M000339">Component#backtrack_state</a> for more
|
503
852
|
information.
|
504
853
|
</p>
|
505
854
|
<dl>
|
@@ -508,10 +857,10 @@ information.
|
|
508
857
|
</dd>
|
509
858
|
</dl>
|
510
859
|
<p><a class="source-toggle" href="#"
|
511
|
-
onclick="toggleCode('
|
512
|
-
<div class="method-source-code" id="
|
860
|
+
onclick="toggleCode('M000381-source');return false;">[Source]</a></p>
|
861
|
+
<div class="method-source-code" id="M000381-source">
|
513
862
|
<pre>
|
514
|
-
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line
|
863
|
+
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 97</span>
|
515
864
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">backtrack_state</span>(<span class="ruby-identifier">snapshot</span>)
|
516
865
|
<span class="ruby-keyword kw">end</span>
|
517
866
|
</pre>
|
@@ -519,211 +868,46 @@ information.
|
|
519
868
|
</div>
|
520
869
|
</div>
|
521
870
|
|
522
|
-
|
523
|
-
|
524
|
-
<div id="section">
|
525
|
-
<h2 class="section-title"><a name="SEC00091">Session</a></h2>
|
526
|
-
<div class="section-comment">
|
527
|
-
|
528
|
-
</div>
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
<!-- if method_list -->
|
538
|
-
<div id="methods">
|
539
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
540
|
-
|
541
|
-
<div id="method-M000295" class="method-detail">
|
542
|
-
<a name="M000295"></a>
|
871
|
+
<div id="method-M000383" class="method-detail">
|
872
|
+
<a name="M000383"></a>
|
543
873
|
|
544
874
|
<div class="method-heading">
|
545
|
-
<a href="#
|
546
|
-
<span class="method-name">
|
547
|
-
</a>
|
548
|
-
</div>
|
549
|
-
|
550
|
-
<div class="method-description">
|
551
|
-
<p>
|
552
|
-
Returns the current session. A presenter (or component) has always an
|
553
|
-
associated session. The returned object is of class <a
|
554
|
-
href="Session.html">Wee::Session</a> or a subclass thereof.
|
555
|
-
</p>
|
556
|
-
<p><a class="source-toggle" href="#"
|
557
|
-
onclick="toggleCode('M000295-source');return false;">[Source]</a></p>
|
558
|
-
<div class="method-source-code" id="M000295-source">
|
559
|
-
<pre>
|
560
|
-
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 128</span>
|
561
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">session</span>
|
562
|
-
<span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">Session</span>.<span class="ruby-identifier">current</span>
|
563
|
-
<span class="ruby-keyword kw">end</span>
|
564
|
-
</pre>
|
565
|
-
</div>
|
566
|
-
</div>
|
567
|
-
</div>
|
568
|
-
|
569
|
-
|
570
|
-
</div>
|
571
|
-
<div id="section">
|
572
|
-
<h2 class="section-title"><a name="SEC00092">Properties</a></h2>
|
573
|
-
<div class="section-comment">
|
574
|
-
|
575
|
-
</div>
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
<div id="attribute-list">
|
582
|
-
<h3 class="section-bar">Attributes</h3>
|
583
|
-
|
584
|
-
<div class="name-list">
|
585
|
-
<table>
|
586
|
-
<tr class="top-aligned-row context-row">
|
587
|
-
<td class="context-item-name">properties</td>
|
588
|
-
<td class="context-item-value"> [RW] </td>
|
589
|
-
<td class="context-item-desc"></td>
|
590
|
-
</tr>
|
591
|
-
</table>
|
592
|
-
</div>
|
593
|
-
</div>
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
<!-- if method_list -->
|
598
|
-
<div id="methods">
|
599
|
-
<h3 class="section-bar">Public Class methods</h3>
|
600
|
-
|
601
|
-
<div id="method-M000298" class="method-detail">
|
602
|
-
<a name="M000298"></a>
|
603
|
-
|
604
|
-
<div class="method-heading">
|
605
|
-
<a href="#M000298" class="method-signature">
|
606
|
-
<span class="method-name">uses_property</span><span class="method-args">(*args)</span>
|
607
|
-
</a>
|
608
|
-
</div>
|
609
|
-
|
610
|
-
<div class="method-description">
|
611
|
-
<p>
|
612
|
-
This is currently only used for describing which properties are required by
|
613
|
-
the underlying component.
|
614
|
-
</p>
|
615
|
-
<p><a class="source-toggle" href="#"
|
616
|
-
onclick="toggleCode('M000298-source');return false;">[Source]</a></p>
|
617
|
-
<div class="method-source-code" id="M000298-source">
|
618
|
-
<pre>
|
619
|
-
<span class="ruby-comment cmt"># File lib/wee/core/presenter.rb, line 197</span>
|
620
|
-
<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>)
|
621
|
-
<span class="ruby-keyword kw">end</span>
|
622
|
-
</pre>
|
623
|
-
</div>
|
624
|
-
</div>
|
625
|
-
</div>
|
626
|
-
|
627
|
-
<h3 class="section-bar">Public Instance methods</h3>
|
628
|
-
|
629
|
-
<div id="method-M000296" class="method-detail">
|
630
|
-
<a name="M000296"></a>
|
631
|
-
|
632
|
-
<div class="method-heading">
|
633
|
-
<a href="#M000296" class="method-signature">
|
634
|
-
<span class="method-name">get_property</span><span class="method-args">(prop)</span>
|
875
|
+
<a href="#M000383" class="method-signature">
|
876
|
+
<span class="method-name">renderer_class</span><span class="method-args">()</span>
|
635
877
|
</a>
|
636
878
|
</div>
|
637
879
|
|
638
880
|
<div class="method-description">
|
639
|
-
<p>
|
640
|
-
Returns an "owned" property.
|
641
|
-
</p>
|
642
881
|
<p><a class="source-toggle" href="#"
|
643
|
-
onclick="toggleCode('
|
644
|
-
<div class="method-source-code" id="
|
882
|
+
onclick="toggleCode('M000383-source');return false;">[Source]</a></p>
|
883
|
+
<div class="method-source-code" id="M000383-source">
|
645
884
|
<pre>
|
646
|
-
<span class="ruby-comment cmt"># File lib/wee/
|
647
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
648
|
-
<span class="ruby-
|
649
|
-
<span class="ruby-ivar">@properties</span>[<span class="ruby-identifier">prop</span>]
|
650
|
-
<span class="ruby-keyword kw">else</span>
|
651
|
-
<span class="ruby-keyword kw">nil</span>
|
652
|
-
<span class="ruby-keyword kw">end</span>
|
885
|
+
<span class="ruby-comment cmt"># File lib/wee/adaptors/nitro.rb, line 20</span>
|
886
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">renderer_class</span>
|
887
|
+
<span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">Nitro</span><span class="ruby-operator">::</span><span class="ruby-constant">HtmlCanvasRenderer</span>
|
653
888
|
<span class="ruby-keyword kw">end</span>
|
654
889
|
</pre>
|
655
890
|
</div>
|
656
891
|
</div>
|
657
892
|
</div>
|
658
893
|
|
659
|
-
<div id="method-
|
660
|
-
<a name="
|
894
|
+
<div id="method-M000382" class="method-detail">
|
895
|
+
<a name="M000382"></a>
|
661
896
|
|
662
897
|
<div class="method-heading">
|
663
|
-
<a href="#
|
664
|
-
<span class="method-name">
|
898
|
+
<a href="#M000382" class="method-signature">
|
899
|
+
<span class="method-name">renderer_class</span><span class="method-args">()</span>
|
665
900
|
</a>
|
666
901
|
</div>
|
667
902
|
|
668
903
|
<div class="method-description">
|
669
|
-
<p>
|
670
|
-
Tries to lookup a property from different places. <tt>nil</tt> as property
|
671
|
-
value is not allowed!
|
672
|
-
</p>
|
673
|
-
<p>
|
674
|
-
Search order:
|
675
|
-
</p>
|
676
|
-
<ol>
|
677
|
-
<li>self.get_property(prop)
|
678
|
-
|
679
|
-
</li>
|
680
|
-
<li>session.get_property(prop, self.class)
|
681
|
-
|
682
|
-
</li>
|
683
|
-
<li>application.get_property(prop, self.class)
|
684
|
-
|
685
|
-
</li>
|
686
|
-
<li>session.get_property(prop, nil)
|
687
|
-
|
688
|
-
</li>
|
689
|
-
<li>application.get_property(prop, nil)
|
690
|
-
|
691
|
-
</li>
|
692
|
-
<li>@@properties[prop]
|
693
|
-
|
694
|
-
</li>
|
695
|
-
</ol>
|
696
904
|
<p><a class="source-toggle" href="#"
|
697
|
-
onclick="toggleCode('
|
698
|
-
<div class="method-source-code" id="
|
905
|
+
onclick="toggleCode('M000382-source');return false;">[Source]</a></p>
|
906
|
+
<div class="method-source-code" id="M000382-source">
|
699
907
|
<pre>
|
700
|
-
<span class="ruby-comment cmt"># File lib/wee/
|
701
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
702
|
-
<span class="ruby-
|
703
|
-
<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>
|
704
|
-
|
705
|
-
<span class="ruby-identifier">sess</span> = <span class="ruby-identifier">session</span>()
|
706
|
-
<span class="ruby-identifier">app</span> = <span class="ruby-identifier">sess</span>.<span class="ruby-identifier">application</span>
|
707
|
-
<span class="ruby-identifier">klass</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>
|
708
|
-
|
709
|
-
<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>)
|
710
|
-
<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>
|
711
|
-
|
712
|
-
<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>)
|
713
|
-
<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>
|
714
|
-
|
715
|
-
<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>)
|
716
|
-
<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>
|
717
|
-
|
718
|
-
<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>)
|
719
|
-
<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>
|
720
|
-
|
721
|
-
<span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">defined?</span>(<span class="ruby-ivar">@@properties</span>)
|
722
|
-
<span class="ruby-identifier">val</span> = <span class="ruby-ivar">@@properties</span>[<span class="ruby-identifier">prop</span>]
|
723
|
-
<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>
|
724
|
-
<span class="ruby-keyword kw">end</span>
|
725
|
-
|
726
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
|
908
|
+
<span class="ruby-comment cmt"># File lib/wee/adaptors/rails.rb, line 20</span>
|
909
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">renderer_class</span>
|
910
|
+
<span class="ruby-constant">Wee</span><span class="ruby-operator">::</span><span class="ruby-constant">Rails</span><span class="ruby-operator">::</span><span class="ruby-constant">HtmlCanvasRenderer</span>
|
727
911
|
<span class="ruby-keyword kw">end</span>
|
728
912
|
</pre>
|
729
913
|
</div>
|