view_models 2.0.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.bundle/config +2 -0
- data/.gitignore +8 -0
- data/.rspec +2 -0
- data/.rvmrc +1 -0
- data/.travis.yml +19 -0
- data/.yardoc/checksums +13 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/Appraisals +15 -0
- data/CHANGELOG +31 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +174 -0
- data/MIT-LICENSE +20 -0
- data/README.textile +199 -0
- data/Rakefile +24 -0
- data/doc/ModulesInRenderHierarchy.html +186 -0
- data/doc/ModulesInRenderHierarchy/ClassMethods.html +188 -0
- data/doc/ViewModels.html +202 -0
- data/doc/ViewModels/Base.html +1342 -0
- data/doc/ViewModels/ContextExtractor.html +406 -0
- data/doc/ViewModels/Extensions.html +128 -0
- data/doc/ViewModels/Extensions/ModelReader.html +255 -0
- data/doc/ViewModels/Extensions/ModelReader/FilteredDelegationInstaller.html +908 -0
- data/doc/ViewModels/Extensions/ModelReader/Options.html +551 -0
- data/doc/ViewModels/Extensions/View.html +303 -0
- data/doc/ViewModels/Helpers.html +129 -0
- data/doc/ViewModels/Helpers/Mapping.html +562 -0
- data/doc/ViewModels/Helpers/Mapping/Collection.html +844 -0
- data/doc/ViewModels/Helpers/View.html +287 -0
- data/doc/ViewModels/PathStore.html +745 -0
- data/doc/ViewModels/RenderOptions.html +126 -0
- data/doc/ViewModels/RenderOptions/Base.html +1187 -0
- data/doc/ViewModels/RenderOptions/Partial.html +231 -0
- data/doc/ViewModels/RenderOptions/Template.html +231 -0
- data/doc/ViewModels/View.html +414 -0
- data/doc/ViewModelsGenerator.html +410 -0
- data/doc/_index.html +317 -0
- data/doc/class_list.html +53 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +328 -0
- data/doc/file.README.html +113 -0
- data/doc/file_list.html +55 -0
- data/doc/frames.html +28 -0
- data/doc/index.html +113 -0
- data/doc/js/app.js +214 -0
- data/doc/js/full_list.js +173 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +628 -0
- data/doc/top-level-namespace.html +114 -0
- data/feature_support/testapp/app/controllers/heroes_controller.rb +6 -0
- data/feature_support/testapp/app/controllers/users_controller.rb +6 -0
- data/feature_support/testapp/app/helpers/application_helper.rb +8 -0
- data/feature_support/testapp/app/models/hero.rb +8 -0
- data/feature_support/testapp/app/models/user.rb +3 -0
- data/feature_support/testapp/app/view_models/hero.rb +8 -0
- data/feature_support/testapp/app/view_models/test.rb +8 -0
- data/feature_support/testapp/app/view_models/user.rb +14 -0
- data/feature_support/testapp/app/views/heroes/show.html.slim +6 -0
- data/feature_support/testapp/app/views/users/_box.html.slim +8 -0
- data/feature_support/testapp/app/views/users/show.html.slim +6 -0
- data/feature_support/testapp/config/application.rb +64 -0
- data/feature_support/testapp/config/cucumber.yml +8 -0
- data/feature_support/testapp/config/database.yml +28 -0
- data/feature_support/testapp/config/environments/cucumber.rb +11 -0
- data/feature_support/testapp/config/environments/test.rb +27 -0
- data/feature_support/testapp/config/routes.rb +4 -0
- data/feature_support/testapp/db/migrate/1_create_users.rb +13 -0
- data/feature_support/testapp/features/inheritance.feature +16 -0
- data/feature_support/testapp/features/step_definitions/testapp_steps.rb +16 -0
- data/feature_support/testapp/features/support/env.rb +13 -0
- data/feature_support/testapp/features/users.feature +15 -0
- data/feature_support/testapp/lib/tasks/cucumber.rake +31 -0
- data/feature_support/testapp/spec/factories/heroes.rb +7 -0
- data/feature_support/testapp/spec/factories/users.rb +7 -0
- data/features/rails_integration.feature +21 -0
- data/features/step_definitions/rails_steps.rb +112 -0
- data/features/support/env.rb +6 -0
- data/gemfiles/3.0.Gemfile +13 -0
- data/gemfiles/3.1.Gemfile +15 -0
- data/gemfiles/3.2.gemfile +15 -0
- data/lib/rails/generators/view_models/USAGE +6 -0
- data/lib/rails/generators/view_models/templates/views/_collection.html.erb +6 -0
- data/lib/{rails2/generators/view_models/templates/views/view_models/collection → rails/generators/view_models/templates/views}/_collection.html.haml +1 -2
- data/lib/rails/generators/view_models/templates/views/_collection.html.slim +6 -0
- data/lib/{rails2/generators/view_models/templates/views/_empty.html.haml → rails/generators/view_models/templates/views/_empty.html.erb} +0 -0
- data/lib/rails/generators/view_models/templates/views/_empty.html.haml +0 -0
- data/lib/rails/generators/view_models/templates/views/_empty.html.slim +0 -0
- data/lib/rails/generators/view_models/templates/views/_list.html.erb +6 -0
- data/lib/rails/generators/view_models/templates/views/_list.html.haml +4 -0
- data/lib/rails/generators/view_models/templates/views/_list.html.slim +5 -0
- data/lib/rails/generators/view_models/templates/views/_pagination.html.erb +18 -0
- data/lib/{rails2/generators/view_models/templates/views/view_models/collection → rails/generators/view_models/templates/views}/_pagination.html.haml +2 -2
- data/lib/rails/generators/view_models/templates/views/_pagination.html.slim +12 -0
- data/lib/rails/generators/view_models/templates/views/_table.html.erb +10 -0
- data/lib/{rails2/generators/view_models/templates/views/view_models/collection → rails/generators/view_models/templates/views}/_table.html.haml +0 -0
- data/lib/rails/generators/view_models/templates/views/_table.html.slim +5 -0
- data/lib/rails/generators/view_models/view_models_generator.rb +57 -0
- data/lib/view_models.rb +15 -5
- data/lib/{shared/lib/view_models → view_models}/base.rb +148 -37
- data/lib/{shared/lib/view_models → view_models}/context_extractor.rb +6 -2
- data/lib/{shared/lib/view_models → view_models}/extensions/model_reader.rb +27 -13
- data/lib/{rails2/lib → view_models}/extensions/view.rb +6 -1
- data/lib/view_models/helpers/collection.rb +113 -0
- data/lib/{shared/lib/view_models → view_models}/helpers/mapping.rb +12 -15
- data/lib/{rails2/lib → view_models}/helpers/view.rb +5 -1
- data/lib/{shared/lib/view_models → view_models}/path_store.rb +6 -1
- data/lib/{shared/lib/view_models → view_models}/render_options.rb +19 -4
- data/lib/view_models/version.rb +5 -0
- data/lib/{rails2/lib/view_models → view_models}/view.rb +7 -6
- data/spec/{rails2/lib → lib}/view_models/base_spec.rb +38 -5
- data/spec/{rails2/lib → lib/view_models}/extensions/model_reader_spec.rb +4 -4
- data/spec/{shared/lib → lib/view_models}/helpers/collection_spec.rb +21 -1
- data/spec/{shared/lib → lib/view_models}/helpers/mapping_spec.rb +6 -5
- data/spec/{rails2/lib → lib/view_models}/helpers/view_spec.rb +1 -1
- data/spec/lib/view_models/view_spec.rb +42 -0
- data/spec/spec_helper.rb +32 -0
- data/spec/spec_helper_extensions.rb +13 -0
- data/view_models.gemspec +36 -0
- metadata +411 -142
- data/lib/init.rb +0 -1
- data/lib/padrino/README.textile +0 -3
- data/lib/padrino/init.rb +0 -10
- data/lib/padrino/lib/helpers/collection.rb +0 -27
- data/lib/padrino/lib/padrino/view_models.rb +0 -19
- data/lib/padrino/lib/view_models/base.rb +0 -65
- data/lib/rails2/README.textile +0 -3
- data/lib/rails2/TODO.textile +0 -5
- data/lib/rails2/generators/view_models/USAGE +0 -6
- data/lib/rails2/generators/view_models/templates/README +0 -1
- data/lib/rails2/generators/view_models/templates/spec/view_model_spec.rb +0 -7
- data/lib/rails2/generators/view_models/templates/view_models/view_model.rb +0 -5
- data/lib/rails2/generators/view_models/templates/views/view_models/collection/_collection.html.erb +0 -1
- data/lib/rails2/generators/view_models/templates/views/view_models/collection/_collection.text.erb +0 -6
- data/lib/rails2/generators/view_models/templates/views/view_models/collection/_list.html.erb +0 -1
- data/lib/rails2/generators/view_models/templates/views/view_models/collection/_list.text.erb +0 -6
- data/lib/rails2/generators/view_models/templates/views/view_models/collection/_pagination.text.erb +0 -3
- data/lib/rails2/generators/view_models/templates/views/view_models/collection/_table.text.erb +0 -10
- data/lib/rails2/generators/view_models/view_models_generator.rb +0 -47
- data/lib/rails2/init.rb +0 -18
- data/lib/rails2/lib/experimental/README.textile +0 -32
- data/lib/rails2/lib/experimental/modules_in_render_hierarchy.rb +0 -21
- data/lib/rails2/lib/helpers/collection.rb +0 -27
- data/lib/rails2/lib/view_models.rb +0 -1
- data/lib/rails2/lib/view_models/base.rb +0 -99
- data/lib/shared/README.textile +0 -3
- data/lib/shared/init.rb +0 -11
- data/lib/shared/lib/view_models.rb +0 -4
- data/lib/shared/lib/view_models/extensions/active_record.rb +0 -27
- data/lib/shared/lib/view_models/helpers/collection.rb +0 -110
- data/spec/padrino/integration/integration_spec.rb +0 -287
- data/spec/padrino/lib/helpers/collection_spec.rb +0 -30
- data/spec/rails2/integration/integration_spec.rb +0 -279
- data/spec/rails2/lib/extensions/active_record_spec.rb +0 -31
- data/spec/rails2/lib/helpers/collection_spec.rb +0 -30
- data/spec/rails2/lib/view_models/view_spec.rb +0 -12
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
|
+
<title>
|
|
7
|
+
Module: ViewModels::Helpers::View
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.8.3
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
|
19
|
+
relpath = '../../';
|
|
20
|
+
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
|
25
|
+
|
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
</head>
|
|
30
|
+
<body>
|
|
31
|
+
<div id="header">
|
|
32
|
+
<div id="menu">
|
|
33
|
+
|
|
34
|
+
<a href="../../_index.html">Index (V)</a> »
|
|
35
|
+
<span class='title'><span class='object_link'><a href="../../ViewModels.html" title="ViewModels (module)">ViewModels</a></span></span> » <span class='title'><span class='object_link'><a href="../Helpers.html" title="ViewModels::Helpers (module)">Helpers</a></span></span>
|
|
36
|
+
»
|
|
37
|
+
<span class="title">View</span>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div id="search">
|
|
44
|
+
|
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
|
46
|
+
href="../../class_list.html">
|
|
47
|
+
Class List
|
|
48
|
+
</a>
|
|
49
|
+
|
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
|
51
|
+
href="../../method_list.html">
|
|
52
|
+
Method List
|
|
53
|
+
</a>
|
|
54
|
+
|
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
|
56
|
+
href="../../file_list.html">
|
|
57
|
+
File List
|
|
58
|
+
</a>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
<div class="clear"></div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<iframe id="search_frame"></iframe>
|
|
65
|
+
|
|
66
|
+
<div id="content"><h1>Module: ViewModels::Helpers::View
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
</h1>
|
|
71
|
+
|
|
72
|
+
<dl class="box">
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
<dt class="r1 last">Defined in:</dt>
|
|
82
|
+
<dd class="r1 last">lib/view_models/helpers/view.rb</dd>
|
|
83
|
+
|
|
84
|
+
</dl>
|
|
85
|
+
<div class="clear"></div>
|
|
86
|
+
|
|
87
|
+
<h2>Overview</h2><div class="docstring">
|
|
88
|
+
<div class="discussion">
|
|
89
|
+
|
|
90
|
+
<p>Module for conveniently including common view_helpers into a view_model</p>
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
<div class="tags">
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
<h2>
|
|
107
|
+
Class Method Summary
|
|
108
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
|
109
|
+
</h2>
|
|
110
|
+
|
|
111
|
+
<ul class="summary">
|
|
112
|
+
|
|
113
|
+
<li class="public ">
|
|
114
|
+
<span class="summary_signature">
|
|
115
|
+
|
|
116
|
+
<a href="#all_view_helpers-class_method" title="all_view_helpers (class method)">+ (Array) <strong>all_view_helpers</strong> </a>
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
</span>
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
<span class="summary_desc"><div class='inline'>
|
|
131
|
+
<p>The common view helpers.</p>
|
|
132
|
+
</div></span>
|
|
133
|
+
|
|
134
|
+
</li>
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
<li class="public ">
|
|
138
|
+
<span class="summary_signature">
|
|
139
|
+
|
|
140
|
+
<a href="#included-class_method" title="included (class method)">+ (Object) <strong>included</strong>(view_model) </a>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
</span>
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
<span class="summary_desc"><div class='inline'>
|
|
155
|
+
<p>Include hook for the view.</p>
|
|
156
|
+
</div></span>
|
|
157
|
+
|
|
158
|
+
</li>
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
</ul>
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
<div id="class_method_details" class="method_details_list">
|
|
167
|
+
<h2>Class Method Details</h2>
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
<div class="method_details first">
|
|
171
|
+
<h3 class="signature first" id="all_view_helpers-class_method">
|
|
172
|
+
|
|
173
|
+
+ (<tt>Array</tt>) <strong>all_view_helpers</strong>
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
</h3><div class="docstring">
|
|
180
|
+
<div class="discussion">
|
|
181
|
+
|
|
182
|
+
<p>The common view helpers</p>
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
</div>
|
|
186
|
+
</div>
|
|
187
|
+
<div class="tags">
|
|
188
|
+
|
|
189
|
+
<p class="tag_title">Returns:</p>
|
|
190
|
+
<ul class="return">
|
|
191
|
+
|
|
192
|
+
<li>
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
—
|
|
200
|
+
<div class='inline'>
|
|
201
|
+
<p>an array of common view helpers</p>
|
|
202
|
+
</div>
|
|
203
|
+
|
|
204
|
+
</li>
|
|
205
|
+
|
|
206
|
+
</ul>
|
|
207
|
+
|
|
208
|
+
</div><table class="source_code">
|
|
209
|
+
<tr>
|
|
210
|
+
<td>
|
|
211
|
+
<pre class="lines">
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
17
|
|
215
|
+
18
|
|
216
|
+
19
|
|
217
|
+
20
|
|
218
|
+
21
|
|
219
|
+
22</pre>
|
|
220
|
+
</td>
|
|
221
|
+
<td>
|
|
222
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/helpers/view.rb', line 17</span>
|
|
223
|
+
|
|
224
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_all_view_helpers'>all_view_helpers</span>
|
|
225
|
+
<span class='lbracket'>[</span>
|
|
226
|
+
<span class='const'>ActionView</span><span class='op'>::</span><span class='const'>Helpers</span><span class='comma'>,</span>
|
|
227
|
+
<span class='const'>ERB</span><span class='op'>::</span><span class='const'>Util</span>
|
|
228
|
+
<span class='rbracket'>]</span>
|
|
229
|
+
<span class='kw'>end</span></pre>
|
|
230
|
+
</td>
|
|
231
|
+
</tr>
|
|
232
|
+
</table>
|
|
233
|
+
</div>
|
|
234
|
+
|
|
235
|
+
<div class="method_details ">
|
|
236
|
+
<h3 class="signature " id="included-class_method">
|
|
237
|
+
|
|
238
|
+
+ (<tt>Object</tt>) <strong>included</strong>(view_model)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
</h3><div class="docstring">
|
|
245
|
+
<div class="discussion">
|
|
246
|
+
|
|
247
|
+
<p>Include hook for the view</p>
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
</div>
|
|
251
|
+
</div>
|
|
252
|
+
<div class="tags">
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
</div><table class="source_code">
|
|
256
|
+
<tr>
|
|
257
|
+
<td>
|
|
258
|
+
<pre class="lines">
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
10
|
|
262
|
+
11
|
|
263
|
+
12</pre>
|
|
264
|
+
</td>
|
|
265
|
+
<td>
|
|
266
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/helpers/view.rb', line 10</span>
|
|
267
|
+
|
|
268
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_included'>included</span> <span class='id identifier rubyid_view_model'>view_model</span>
|
|
269
|
+
<span class='id identifier rubyid_view_model'>view_model</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span> <span class='symbol'>:include</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_all_view_helpers'>all_view_helpers</span>
|
|
270
|
+
<span class='kw'>end</span></pre>
|
|
271
|
+
</td>
|
|
272
|
+
</tr>
|
|
273
|
+
</table>
|
|
274
|
+
</div>
|
|
275
|
+
|
|
276
|
+
</div>
|
|
277
|
+
|
|
278
|
+
</div>
|
|
279
|
+
|
|
280
|
+
<div id="footer">
|
|
281
|
+
Generated on Tue Oct 16 23:27:34 2012 by
|
|
282
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
283
|
+
0.8.3 (ruby-1.9.3).
|
|
284
|
+
</div>
|
|
285
|
+
|
|
286
|
+
</body>
|
|
287
|
+
</html>
|
|
@@ -0,0 +1,745 @@
|
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
6
|
+
<title>
|
|
7
|
+
Class: ViewModels::PathStore
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.8.3
|
|
10
|
+
|
|
11
|
+
</title>
|
|
12
|
+
|
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
|
14
|
+
|
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
|
16
|
+
|
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
|
19
|
+
relpath = '../';
|
|
20
|
+
framesUrl = "../frames.html#!" + escape(window.location.href);
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
|
25
|
+
|
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
</head>
|
|
30
|
+
<body>
|
|
31
|
+
<div id="header">
|
|
32
|
+
<div id="menu">
|
|
33
|
+
|
|
34
|
+
<a href="../_index.html">Index (P)</a> »
|
|
35
|
+
<span class='title'><span class='object_link'><a href="../ViewModels.html" title="ViewModels (module)">ViewModels</a></span></span>
|
|
36
|
+
»
|
|
37
|
+
<span class="title">PathStore</span>
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div id="search">
|
|
44
|
+
|
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
|
46
|
+
href="../class_list.html">
|
|
47
|
+
Class List
|
|
48
|
+
</a>
|
|
49
|
+
|
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
|
51
|
+
href="../method_list.html">
|
|
52
|
+
Method List
|
|
53
|
+
</a>
|
|
54
|
+
|
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
|
56
|
+
href="../file_list.html">
|
|
57
|
+
File List
|
|
58
|
+
</a>
|
|
59
|
+
|
|
60
|
+
</div>
|
|
61
|
+
<div class="clear"></div>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<iframe id="search_frame"></iframe>
|
|
65
|
+
|
|
66
|
+
<div id="content"><h1>Class: ViewModels::PathStore
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
</h1>
|
|
71
|
+
|
|
72
|
+
<dl class="box">
|
|
73
|
+
|
|
74
|
+
<dt class="r1">Inherits:</dt>
|
|
75
|
+
<dd class="r1">
|
|
76
|
+
<span class="inheritName">Object</span>
|
|
77
|
+
|
|
78
|
+
<ul class="fullTree">
|
|
79
|
+
<li>Object</li>
|
|
80
|
+
|
|
81
|
+
<li class="next">ViewModels::PathStore</li>
|
|
82
|
+
|
|
83
|
+
</ul>
|
|
84
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
85
|
+
|
|
86
|
+
</dd>
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
<dt class="r2 last">Defined in:</dt>
|
|
97
|
+
<dd class="r2 last">lib/view_models/path_store.rb</dd>
|
|
98
|
+
|
|
99
|
+
</dl>
|
|
100
|
+
<div class="clear"></div>
|
|
101
|
+
|
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
|
103
|
+
<div class="discussion">
|
|
104
|
+
|
|
105
|
+
<p>A simple path store. Designed to remove a bit of complexity from the base
|
|
106
|
+
view model.</p>
|
|
107
|
+
|
|
108
|
+
<p>Use it to install an instance in the metaclass.</p>
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
<div class="tags">
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
|
121
|
+
<ul class="summary">
|
|
122
|
+
|
|
123
|
+
<li class="public ">
|
|
124
|
+
<span class="summary_signature">
|
|
125
|
+
|
|
126
|
+
<a href="#view_model_class-instance_method" title="#view_model_class (instance method)">- (Object) <strong>view_model_class</strong> </a>
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
</span>
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
<span class="note title readonly">readonly</span>
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
<span class="summary_desc"><div class='inline'>
|
|
146
|
+
<p>The view model class attribute.</p>
|
|
147
|
+
</div></span>
|
|
148
|
+
|
|
149
|
+
</li>
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
</ul>
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
<h2>
|
|
159
|
+
Class Method Summary
|
|
160
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
|
161
|
+
</h2>
|
|
162
|
+
|
|
163
|
+
<ul class="summary">
|
|
164
|
+
|
|
165
|
+
<li class="public ">
|
|
166
|
+
<span class="summary_signature">
|
|
167
|
+
|
|
168
|
+
<a href="#install_in-class_method" title="install_in (class method)">+ (Object) <strong>install_in</strong>(klass) </a>
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
</span>
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
<span class="summary_desc"><div class='inline'>
|
|
183
|
+
<p>Install in the metaclass (as an example).</p>
|
|
184
|
+
</div></span>
|
|
185
|
+
|
|
186
|
+
</li>
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
</ul>
|
|
190
|
+
|
|
191
|
+
<h2>
|
|
192
|
+
Instance Method Summary
|
|
193
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
|
194
|
+
</h2>
|
|
195
|
+
|
|
196
|
+
<ul class="summary">
|
|
197
|
+
|
|
198
|
+
<li class="public ">
|
|
199
|
+
<span class="summary_signature">
|
|
200
|
+
|
|
201
|
+
<a href="#%5B%5D-instance_method" title="#[] (instance method)">- (Object) <strong>[]</strong>(key) </a>
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
</span>
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
<span class="summary_desc"><div class='inline'>
|
|
216
|
+
<p>Simple [] delegation.</p>
|
|
217
|
+
</div></span>
|
|
218
|
+
|
|
219
|
+
</li>
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
<li class="public ">
|
|
223
|
+
<span class="summary_signature">
|
|
224
|
+
|
|
225
|
+
<a href="#%5B%5D%3D-instance_method" title="#[]= (instance method)">- (Object) <strong>[]=</strong>(key, path) </a>
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
</span>
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
<span class="summary_desc"><div class='inline'>
|
|
240
|
+
<p>Does not save values for nil keys.</p>
|
|
241
|
+
</div></span>
|
|
242
|
+
|
|
243
|
+
</li>
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
<li class="public ">
|
|
247
|
+
<span class="summary_signature">
|
|
248
|
+
|
|
249
|
+
<a href="#cached-instance_method" title="#cached (instance method)">- (Object) <strong>cached</strong>(options, &block) </a>
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
</span>
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
<span class="summary_desc"><div class='inline'>
|
|
264
|
+
<p>Cache the result of the rendering.</p>
|
|
265
|
+
</div></span>
|
|
266
|
+
|
|
267
|
+
</li>
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
<li class="public ">
|
|
271
|
+
<span class="summary_signature">
|
|
272
|
+
|
|
273
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (PathStore) <strong>initialize</strong>(view_model_class) </a>
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
</span>
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
<span class="note title constructor">constructor</span>
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
<span class="summary_desc"><div class='inline'>
|
|
290
|
+
<p>Initialize the path store.</p>
|
|
291
|
+
</div></span>
|
|
292
|
+
|
|
293
|
+
</li>
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
<li class="public ">
|
|
297
|
+
<span class="summary_signature">
|
|
298
|
+
|
|
299
|
+
<a href="#prepare-instance_method" title="#prepare (instance method)">- (Object) <strong>prepare</strong>(key) </a>
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
</span>
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
<span class="summary_desc"><div class='inline'>
|
|
314
|
+
<p>Prepare the key for the next storing procedure.</p>
|
|
315
|
+
</div></span>
|
|
316
|
+
|
|
317
|
+
</li>
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
<li class="public ">
|
|
321
|
+
<span class="summary_signature">
|
|
322
|
+
|
|
323
|
+
<a href="#save-instance_method" title="#save (instance method)">- (Object) <strong>save</strong>(options) </a>
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
</span>
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
<span class="summary_desc"><div class='inline'>
|
|
338
|
+
<p>Saves the options for the prepared key.</p>
|
|
339
|
+
</div></span>
|
|
340
|
+
|
|
341
|
+
</li>
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
</ul>
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
<div id="constructor_details" class="method_details_list">
|
|
348
|
+
<h2>Constructor Details</h2>
|
|
349
|
+
|
|
350
|
+
<div class="method_details first">
|
|
351
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
352
|
+
|
|
353
|
+
- (<tt><span class='object_link'><a href="" title="ViewModels::PathStore (class)">PathStore</a></span></tt>) <strong>initialize</strong>(view_model_class)
|
|
354
|
+
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
</h3><div class="docstring">
|
|
360
|
+
<div class="discussion">
|
|
361
|
+
|
|
362
|
+
<p>Initialize the path store</p>
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
</div>
|
|
366
|
+
</div>
|
|
367
|
+
<div class="tags">
|
|
368
|
+
<p class="tag_title">Parameters:</p>
|
|
369
|
+
<ul class="param">
|
|
370
|
+
|
|
371
|
+
<li>
|
|
372
|
+
|
|
373
|
+
<span class='name'>view_model_class</span>
|
|
374
|
+
|
|
375
|
+
|
|
376
|
+
<span class='type'>(<tt>ViewModel</tt>)</span>
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
—
|
|
381
|
+
<div class='inline'>
|
|
382
|
+
<p>The view model class</p>
|
|
383
|
+
</div>
|
|
384
|
+
|
|
385
|
+
</li>
|
|
386
|
+
|
|
387
|
+
</ul>
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
</div><table class="source_code">
|
|
391
|
+
<tr>
|
|
392
|
+
<td>
|
|
393
|
+
<pre class="lines">
|
|
394
|
+
|
|
395
|
+
|
|
396
|
+
18
|
|
397
|
+
19
|
|
398
|
+
20
|
|
399
|
+
21</pre>
|
|
400
|
+
</td>
|
|
401
|
+
<td>
|
|
402
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/path_store.rb', line 18</span>
|
|
403
|
+
|
|
404
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='id identifier rubyid_view_model_class'>view_model_class</span>
|
|
405
|
+
<span class='ivar'>@view_model_class</span> <span class='op'>=</span> <span class='id identifier rubyid_view_model_class'>view_model_class</span>
|
|
406
|
+
<span class='ivar'>@name_path_mapping</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
407
|
+
<span class='kw'>end</span></pre>
|
|
408
|
+
</td>
|
|
409
|
+
</tr>
|
|
410
|
+
</table>
|
|
411
|
+
</div>
|
|
412
|
+
|
|
413
|
+
</div>
|
|
414
|
+
|
|
415
|
+
<div id="instance_attr_details" class="attr_details">
|
|
416
|
+
<h2>Instance Attribute Details</h2>
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
<span id=""></span>
|
|
420
|
+
<div class="method_details first">
|
|
421
|
+
<h3 class="signature first" id="view_model_class-instance_method">
|
|
422
|
+
|
|
423
|
+
- (<tt>Object</tt>) <strong>view_model_class</strong> <span class="extras">(readonly)</span>
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
</h3><div class="docstring">
|
|
430
|
+
<div class="discussion">
|
|
431
|
+
|
|
432
|
+
<p>The view model class attribute</p>
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
</div>
|
|
436
|
+
</div>
|
|
437
|
+
<div class="tags">
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
</div><table class="source_code">
|
|
441
|
+
<tr>
|
|
442
|
+
<td>
|
|
443
|
+
<pre class="lines">
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
13
|
|
447
|
+
14
|
|
448
|
+
15</pre>
|
|
449
|
+
</td>
|
|
450
|
+
<td>
|
|
451
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/path_store.rb', line 13</span>
|
|
452
|
+
|
|
453
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_view_model_class'>view_model_class</span>
|
|
454
|
+
<span class='ivar'>@view_model_class</span>
|
|
455
|
+
<span class='kw'>end</span></pre>
|
|
456
|
+
</td>
|
|
457
|
+
</tr>
|
|
458
|
+
</table>
|
|
459
|
+
</div>
|
|
460
|
+
|
|
461
|
+
</div>
|
|
462
|
+
|
|
463
|
+
|
|
464
|
+
<div id="class_method_details" class="method_details_list">
|
|
465
|
+
<h2>Class Method Details</h2>
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
<div class="method_details first">
|
|
469
|
+
<h3 class="signature first" id="install_in-class_method">
|
|
470
|
+
|
|
471
|
+
+ (<tt>Object</tt>) <strong>install_in</strong>(klass)
|
|
472
|
+
|
|
473
|
+
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
</h3><div class="docstring">
|
|
478
|
+
<div class="discussion">
|
|
479
|
+
|
|
480
|
+
<p>Install in the metaclass (as an example).</p>
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
</div>
|
|
484
|
+
</div>
|
|
485
|
+
<div class="tags">
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
</div><table class="source_code">
|
|
489
|
+
<tr>
|
|
490
|
+
<td>
|
|
491
|
+
<pre class="lines">
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
25
|
|
495
|
+
26
|
|
496
|
+
27</pre>
|
|
497
|
+
</td>
|
|
498
|
+
<td>
|
|
499
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/path_store.rb', line 25</span>
|
|
500
|
+
|
|
501
|
+
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_install_in'>install_in</span> <span class='id identifier rubyid_klass'>klass</span>
|
|
502
|
+
<span class='id identifier rubyid_klass'>klass</span><span class='period'>.</span><span class='id identifier rubyid_path_store'>path_store</span> <span class='op'>=</span> <span class='const'>PathStore</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='id identifier rubyid_klass'>klass</span>
|
|
503
|
+
<span class='kw'>end</span></pre>
|
|
504
|
+
</td>
|
|
505
|
+
</tr>
|
|
506
|
+
</table>
|
|
507
|
+
</div>
|
|
508
|
+
|
|
509
|
+
</div>
|
|
510
|
+
|
|
511
|
+
<div id="instance_method_details" class="method_details_list">
|
|
512
|
+
<h2>Instance Method Details</h2>
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
<div class="method_details first">
|
|
516
|
+
<h3 class="signature first" id="[]-instance_method">
|
|
517
|
+
|
|
518
|
+
- (<tt>Object</tt>) <strong>[]</strong>(key)
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
</h3><div class="docstring">
|
|
525
|
+
<div class="discussion">
|
|
526
|
+
|
|
527
|
+
<p>Simple [] delegation.</p>
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
</div>
|
|
531
|
+
</div>
|
|
532
|
+
<div class="tags">
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
</div><table class="source_code">
|
|
536
|
+
<tr>
|
|
537
|
+
<td>
|
|
538
|
+
<pre class="lines">
|
|
539
|
+
|
|
540
|
+
|
|
541
|
+
60
|
|
542
|
+
61
|
|
543
|
+
62</pre>
|
|
544
|
+
</td>
|
|
545
|
+
<td>
|
|
546
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/path_store.rb', line 60</span>
|
|
547
|
+
|
|
548
|
+
<span class='kw'>def</span> <span class='op'>[]</span> <span class='id identifier rubyid_key'>key</span>
|
|
549
|
+
<span class='ivar'>@name_path_mapping</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span>
|
|
550
|
+
<span class='kw'>end</span></pre>
|
|
551
|
+
</td>
|
|
552
|
+
</tr>
|
|
553
|
+
</table>
|
|
554
|
+
</div>
|
|
555
|
+
|
|
556
|
+
<div class="method_details ">
|
|
557
|
+
<h3 class="signature " id="[]=-instance_method">
|
|
558
|
+
|
|
559
|
+
- (<tt>Object</tt>) <strong>[]=</strong>(key, path)
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
|
|
563
|
+
|
|
564
|
+
|
|
565
|
+
</h3><div class="docstring">
|
|
566
|
+
<div class="discussion">
|
|
567
|
+
|
|
568
|
+
<p>Does not save values for nil keys.</p>
|
|
569
|
+
|
|
570
|
+
|
|
571
|
+
</div>
|
|
572
|
+
</div>
|
|
573
|
+
<div class="tags">
|
|
574
|
+
|
|
575
|
+
|
|
576
|
+
</div><table class="source_code">
|
|
577
|
+
<tr>
|
|
578
|
+
<td>
|
|
579
|
+
<pre class="lines">
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
53
|
|
583
|
+
54
|
|
584
|
+
55
|
|
585
|
+
56</pre>
|
|
586
|
+
</td>
|
|
587
|
+
<td>
|
|
588
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/path_store.rb', line 53</span>
|
|
589
|
+
|
|
590
|
+
<span class='kw'>def</span> <span class='op'>[]=</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_path'>path</span>
|
|
591
|
+
<span class='kw'>return</span> <span class='kw'>if</span> <span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
|
592
|
+
<span class='ivar'>@name_path_mapping</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='id identifier rubyid_path'>path</span>
|
|
593
|
+
<span class='kw'>end</span></pre>
|
|
594
|
+
</td>
|
|
595
|
+
</tr>
|
|
596
|
+
</table>
|
|
597
|
+
</div>
|
|
598
|
+
|
|
599
|
+
<div class="method_details ">
|
|
600
|
+
<h3 class="signature " id="cached-instance_method">
|
|
601
|
+
|
|
602
|
+
- (<tt>Object</tt>) <strong>cached</strong>(options, &block)
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
|
|
607
|
+
|
|
608
|
+
</h3><div class="docstring">
|
|
609
|
+
<div class="discussion">
|
|
610
|
+
|
|
611
|
+
<p>Cache the result of the rendering.</p>
|
|
612
|
+
|
|
613
|
+
|
|
614
|
+
</div>
|
|
615
|
+
</div>
|
|
616
|
+
<div class="tags">
|
|
617
|
+
|
|
618
|
+
|
|
619
|
+
</div><table class="source_code">
|
|
620
|
+
<tr>
|
|
621
|
+
<td>
|
|
622
|
+
<pre class="lines">
|
|
623
|
+
|
|
624
|
+
|
|
625
|
+
31
|
|
626
|
+
32
|
|
627
|
+
33
|
|
628
|
+
34
|
|
629
|
+
35</pre>
|
|
630
|
+
</td>
|
|
631
|
+
<td>
|
|
632
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/path_store.rb', line 31</span>
|
|
633
|
+
|
|
634
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_cached'>cached</span> <span class='id identifier rubyid_options'>options</span><span class='comma'>,</span> <span class='op'>&</span><span class='id identifier rubyid_block'>block</span>
|
|
635
|
+
<span class='id identifier rubyid_prepare'>prepare</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_path_key'>path_key</span>
|
|
636
|
+
<span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='id identifier rubyid_block'>block</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
|
|
637
|
+
<span class='id identifier rubyid_save'>save</span> <span class='id identifier rubyid_options'>options</span> <span class='kw'>and</span> <span class='id identifier rubyid_result'>result</span> <span class='kw'>if</span> <span class='id identifier rubyid_result'>result</span>
|
|
638
|
+
<span class='kw'>end</span></pre>
|
|
639
|
+
</td>
|
|
640
|
+
</tr>
|
|
641
|
+
</table>
|
|
642
|
+
</div>
|
|
643
|
+
|
|
644
|
+
<div class="method_details ">
|
|
645
|
+
<h3 class="signature " id="prepare-instance_method">
|
|
646
|
+
|
|
647
|
+
- (<tt>Object</tt>) <strong>prepare</strong>(key)
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
|
|
653
|
+
</h3><div class="docstring">
|
|
654
|
+
<div class="discussion">
|
|
655
|
+
|
|
656
|
+
<div class="note notetag">
|
|
657
|
+
<strong>Note:</strong>
|
|
658
|
+
<div class='inline'>
|
|
659
|
+
<p>If this is nil, the store will not save the path.</p>
|
|
660
|
+
</div>
|
|
661
|
+
</div>
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
<p>Prepare the key for the next storing procedure.</p>
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
</div>
|
|
668
|
+
</div>
|
|
669
|
+
<div class="tags">
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
</div><table class="source_code">
|
|
673
|
+
<tr>
|
|
674
|
+
<td>
|
|
675
|
+
<pre class="lines">
|
|
676
|
+
|
|
677
|
+
|
|
678
|
+
41
|
|
679
|
+
42
|
|
680
|
+
43</pre>
|
|
681
|
+
</td>
|
|
682
|
+
<td>
|
|
683
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/path_store.rb', line 41</span>
|
|
684
|
+
|
|
685
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_prepare'>prepare</span> <span class='id identifier rubyid_key'>key</span>
|
|
686
|
+
<span class='ivar'>@key</span> <span class='op'>=</span> <span class='id identifier rubyid_key'>key</span>
|
|
687
|
+
<span class='kw'>end</span></pre>
|
|
688
|
+
</td>
|
|
689
|
+
</tr>
|
|
690
|
+
</table>
|
|
691
|
+
</div>
|
|
692
|
+
|
|
693
|
+
<div class="method_details ">
|
|
694
|
+
<h3 class="signature " id="save-instance_method">
|
|
695
|
+
|
|
696
|
+
- (<tt>Object</tt>) <strong>save</strong>(options)
|
|
697
|
+
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
</h3><div class="docstring">
|
|
703
|
+
<div class="discussion">
|
|
704
|
+
|
|
705
|
+
<p>Saves the options for the prepared key.</p>
|
|
706
|
+
|
|
707
|
+
|
|
708
|
+
</div>
|
|
709
|
+
</div>
|
|
710
|
+
<div class="tags">
|
|
711
|
+
|
|
712
|
+
|
|
713
|
+
</div><table class="source_code">
|
|
714
|
+
<tr>
|
|
715
|
+
<td>
|
|
716
|
+
<pre class="lines">
|
|
717
|
+
|
|
718
|
+
|
|
719
|
+
47
|
|
720
|
+
48
|
|
721
|
+
49</pre>
|
|
722
|
+
</td>
|
|
723
|
+
<td>
|
|
724
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/path_store.rb', line 47</span>
|
|
725
|
+
|
|
726
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_save'>save</span> <span class='id identifier rubyid_options'>options</span>
|
|
727
|
+
<span class='kw'>self</span><span class='lbracket'>[</span><span class='ivar'>@key</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_file'>file</span>
|
|
728
|
+
<span class='kw'>end</span></pre>
|
|
729
|
+
</td>
|
|
730
|
+
</tr>
|
|
731
|
+
</table>
|
|
732
|
+
</div>
|
|
733
|
+
|
|
734
|
+
</div>
|
|
735
|
+
|
|
736
|
+
</div>
|
|
737
|
+
|
|
738
|
+
<div id="footer">
|
|
739
|
+
Generated on Tue Oct 16 23:27:35 2012 by
|
|
740
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
741
|
+
0.8.3 (ruby-1.9.3).
|
|
742
|
+
</div>
|
|
743
|
+
|
|
744
|
+
</body>
|
|
745
|
+
</html>
|