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,551 @@
|
|
|
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::Extensions::ModelReader::Options
|
|
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 (O)</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="../../Extensions.html" title="ViewModels::Extensions (module)">Extensions</a></span></span> » <span class='title'><span class='object_link'><a href="../ModelReader.html" title="ViewModels::Extensions::ModelReader (module)">ModelReader</a></span></span>
|
|
36
|
+
»
|
|
37
|
+
<span class="title">Options</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::Extensions::ModelReader::Options
|
|
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::Extensions::ModelReader::Options</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/extensions/model_reader.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>Bundles the model reader options and extracts the relevant structured data.</p>
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
<div class="tags">
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
|
118
|
+
<ul class="summary">
|
|
119
|
+
|
|
120
|
+
<li class="public ">
|
|
121
|
+
<span class="summary_signature">
|
|
122
|
+
|
|
123
|
+
<a href="#attributes-instance_method" title="#attributes (instance method)">- (Object) <strong>attributes</strong> </a>
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
</span>
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
<span class="note title readonly">readonly</span>
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
<span class="summary_desc"><div class='inline'>
|
|
143
|
+
<p>Returns the value of attribute attributes.</p>
|
|
144
|
+
</div></span>
|
|
145
|
+
|
|
146
|
+
</li>
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
<li class="public ">
|
|
150
|
+
<span class="summary_signature">
|
|
151
|
+
|
|
152
|
+
<a href="#filters-instance_method" title="#filters (instance method)">- (Object) <strong>filters</strong> </a>
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
</span>
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
<span class="note title readonly">readonly</span>
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
<span class="summary_desc"><div class='inline'>
|
|
172
|
+
<p>Returns the value of attribute filters.</p>
|
|
173
|
+
</div></span>
|
|
174
|
+
|
|
175
|
+
</li>
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
</ul>
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
<h2>
|
|
185
|
+
Instance Method Summary
|
|
186
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
|
187
|
+
</h2>
|
|
188
|
+
|
|
189
|
+
<ul class="summary">
|
|
190
|
+
|
|
191
|
+
<li class="public ">
|
|
192
|
+
<span class="summary_signature">
|
|
193
|
+
|
|
194
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Options) <strong>initialize</strong>(*attributes_and_options) </a>
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
</span>
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
<span class="note title constructor">constructor</span>
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
<span class="summary_desc"><div class='inline'>
|
|
211
|
+
<p>A new instance of Options.</p>
|
|
212
|
+
</div></span>
|
|
213
|
+
|
|
214
|
+
</li>
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
<li class="public ">
|
|
218
|
+
<span class="summary_signature">
|
|
219
|
+
|
|
220
|
+
<a href="#split-instance_method" title="#split (instance method)">- (Object) <strong>split</strong>(options) </a>
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
</span>
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
<span class="summary_desc"><div class='inline'>
|
|
235
|
+
<p>Extract filter_through options from the options hash if there are any.</p>
|
|
236
|
+
</div></span>
|
|
237
|
+
|
|
238
|
+
</li>
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
<li class="public ">
|
|
242
|
+
<span class="summary_signature">
|
|
243
|
+
|
|
244
|
+
<a href="#to_a-instance_method" title="#to_a (instance method)">- (Array) <strong>to_a</strong> </a>
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
</span>
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
<span class="summary_desc"><div class='inline'>
|
|
259
|
+
<p>Render the options to an array.</p>
|
|
260
|
+
</div></span>
|
|
261
|
+
|
|
262
|
+
</li>
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
</ul>
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
<div id="constructor_details" class="method_details_list">
|
|
269
|
+
<h2>Constructor Details</h2>
|
|
270
|
+
|
|
271
|
+
<div class="method_details first">
|
|
272
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
273
|
+
|
|
274
|
+
- (<tt><span class='object_link'><a href="" title="ViewModels::Extensions::ModelReader::Options (class)">Options</a></span></tt>) <strong>initialize</strong>(*attributes_and_options)
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
</h3><div class="docstring">
|
|
281
|
+
<div class="discussion">
|
|
282
|
+
|
|
283
|
+
<p>A new instance of Options</p>
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
</div>
|
|
287
|
+
</div>
|
|
288
|
+
<div class="tags">
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
</div><table class="source_code">
|
|
292
|
+
<tr>
|
|
293
|
+
<td>
|
|
294
|
+
<pre class="lines">
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
38
|
|
298
|
+
39
|
|
299
|
+
40</pre>
|
|
300
|
+
</td>
|
|
301
|
+
<td>
|
|
302
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/extensions/model_reader.rb', line 38</span>
|
|
303
|
+
|
|
304
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='op'>*</span><span class='id identifier rubyid_attributes_and_options'>attributes_and_options</span>
|
|
305
|
+
<span class='id identifier rubyid_split'>split</span> <span class='id identifier rubyid_attributes_and_options'>attributes_and_options</span>
|
|
306
|
+
<span class='kw'>end</span></pre>
|
|
307
|
+
</td>
|
|
308
|
+
</tr>
|
|
309
|
+
</table>
|
|
310
|
+
</div>
|
|
311
|
+
|
|
312
|
+
</div>
|
|
313
|
+
|
|
314
|
+
<div id="instance_attr_details" class="attr_details">
|
|
315
|
+
<h2>Instance Attribute Details</h2>
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
<span id=""></span>
|
|
319
|
+
<div class="method_details first">
|
|
320
|
+
<h3 class="signature first" id="attributes-instance_method">
|
|
321
|
+
|
|
322
|
+
- (<tt>Object</tt>) <strong>attributes</strong> <span class="extras">(readonly)</span>
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
</h3><div class="docstring">
|
|
329
|
+
<div class="discussion">
|
|
330
|
+
|
|
331
|
+
<p>Returns the value of attribute attributes</p>
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
</div>
|
|
335
|
+
</div>
|
|
336
|
+
<div class="tags">
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
</div><table class="source_code">
|
|
340
|
+
<tr>
|
|
341
|
+
<td>
|
|
342
|
+
<pre class="lines">
|
|
343
|
+
|
|
344
|
+
|
|
345
|
+
36
|
|
346
|
+
37
|
|
347
|
+
38</pre>
|
|
348
|
+
</td>
|
|
349
|
+
<td>
|
|
350
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/extensions/model_reader.rb', line 36</span>
|
|
351
|
+
|
|
352
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_attributes'>attributes</span>
|
|
353
|
+
<span class='ivar'>@attributes</span>
|
|
354
|
+
<span class='kw'>end</span></pre>
|
|
355
|
+
</td>
|
|
356
|
+
</tr>
|
|
357
|
+
</table>
|
|
358
|
+
</div>
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
<span id=""></span>
|
|
362
|
+
<div class="method_details ">
|
|
363
|
+
<h3 class="signature " id="filters-instance_method">
|
|
364
|
+
|
|
365
|
+
- (<tt>Object</tt>) <strong>filters</strong> <span class="extras">(readonly)</span>
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
</h3><div class="docstring">
|
|
372
|
+
<div class="discussion">
|
|
373
|
+
|
|
374
|
+
<p>Returns the value of attribute filters</p>
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
</div>
|
|
378
|
+
</div>
|
|
379
|
+
<div class="tags">
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
</div><table class="source_code">
|
|
383
|
+
<tr>
|
|
384
|
+
<td>
|
|
385
|
+
<pre class="lines">
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
36
|
|
389
|
+
37
|
|
390
|
+
38</pre>
|
|
391
|
+
</td>
|
|
392
|
+
<td>
|
|
393
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/extensions/model_reader.rb', line 36</span>
|
|
394
|
+
|
|
395
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_filters'>filters</span>
|
|
396
|
+
<span class='ivar'>@filters</span>
|
|
397
|
+
<span class='kw'>end</span></pre>
|
|
398
|
+
</td>
|
|
399
|
+
</tr>
|
|
400
|
+
</table>
|
|
401
|
+
</div>
|
|
402
|
+
|
|
403
|
+
</div>
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
<div id="instance_method_details" class="method_details_list">
|
|
407
|
+
<h2>Instance Method Details</h2>
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
<div class="method_details first">
|
|
411
|
+
<h3 class="signature first" id="split-instance_method">
|
|
412
|
+
|
|
413
|
+
- (<tt>Object</tt>) <strong>split</strong>(options)
|
|
414
|
+
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
</h3><div class="docstring">
|
|
420
|
+
<div class="discussion">
|
|
421
|
+
|
|
422
|
+
<p>Extract filter_through options from the options hash if there are any.</p>
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
</div>
|
|
426
|
+
</div>
|
|
427
|
+
<div class="tags">
|
|
428
|
+
<p class="tag_title">Parameters:</p>
|
|
429
|
+
<ul class="param">
|
|
430
|
+
|
|
431
|
+
<li>
|
|
432
|
+
|
|
433
|
+
<span class='name'>options</span>
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
|
|
440
|
+
—
|
|
441
|
+
<div class='inline'>
|
|
442
|
+
<p>the options to split</p>
|
|
443
|
+
</div>
|
|
444
|
+
|
|
445
|
+
</li>
|
|
446
|
+
|
|
447
|
+
</ul>
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
</div><table class="source_code">
|
|
451
|
+
<tr>
|
|
452
|
+
<td>
|
|
453
|
+
<pre class="lines">
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
45
|
|
457
|
+
46
|
|
458
|
+
47
|
|
459
|
+
48
|
|
460
|
+
49
|
|
461
|
+
50
|
|
462
|
+
51
|
|
463
|
+
52</pre>
|
|
464
|
+
</td>
|
|
465
|
+
<td>
|
|
466
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/extensions/model_reader.rb', line 45</span>
|
|
467
|
+
|
|
468
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_split'>split</span> <span class='id identifier rubyid_options'>options</span>
|
|
469
|
+
<span class='ivar'>@filters</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_last'>last</span><span class='period'>.</span><span class='id identifier rubyid_kind_of?'>kind_of?</span><span class='lparen'>(</span><span class='const'>Hash</span><span class='rparen'>)</span>
|
|
470
|
+
<span class='lbracket'>[</span><span class='op'>*</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='period'>.</span><span class='id identifier rubyid_pop'>pop</span><span class='lbracket'>[</span><span class='symbol'>:filter_through</span><span class='rbracket'>]</span><span class='rparen'>)</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_reverse'>reverse</span>
|
|
471
|
+
<span class='kw'>else</span>
|
|
472
|
+
<span class='lbracket'>[</span><span class='rbracket'>]</span>
|
|
473
|
+
<span class='kw'>end</span>
|
|
474
|
+
<span class='ivar'>@attributes</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span>
|
|
475
|
+
<span class='kw'>end</span></pre>
|
|
476
|
+
</td>
|
|
477
|
+
</tr>
|
|
478
|
+
</table>
|
|
479
|
+
</div>
|
|
480
|
+
|
|
481
|
+
<div class="method_details ">
|
|
482
|
+
<h3 class="signature " id="to_a-instance_method">
|
|
483
|
+
|
|
484
|
+
- (<tt>Array</tt>) <strong>to_a</strong>
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
|
|
490
|
+
</h3><div class="docstring">
|
|
491
|
+
<div class="discussion">
|
|
492
|
+
|
|
493
|
+
<p>Render the options to an array</p>
|
|
494
|
+
|
|
495
|
+
|
|
496
|
+
</div>
|
|
497
|
+
</div>
|
|
498
|
+
<div class="tags">
|
|
499
|
+
|
|
500
|
+
<p class="tag_title">Returns:</p>
|
|
501
|
+
<ul class="return">
|
|
502
|
+
|
|
503
|
+
<li>
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
|
507
|
+
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
—
|
|
511
|
+
<div class='inline'>
|
|
512
|
+
<p>The attributes and the filters in this order</p>
|
|
513
|
+
</div>
|
|
514
|
+
|
|
515
|
+
</li>
|
|
516
|
+
|
|
517
|
+
</ul>
|
|
518
|
+
|
|
519
|
+
</div><table class="source_code">
|
|
520
|
+
<tr>
|
|
521
|
+
<td>
|
|
522
|
+
<pre class="lines">
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
57
|
|
526
|
+
58
|
|
527
|
+
59</pre>
|
|
528
|
+
</td>
|
|
529
|
+
<td>
|
|
530
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/extensions/model_reader.rb', line 57</span>
|
|
531
|
+
|
|
532
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_a'>to_a</span>
|
|
533
|
+
<span class='lbracket'>[</span><span class='id identifier rubyid_attributes'>attributes</span><span class='comma'>,</span> <span class='id identifier rubyid_filters'>filters</span><span class='rbracket'>]</span>
|
|
534
|
+
<span class='kw'>end</span></pre>
|
|
535
|
+
</td>
|
|
536
|
+
</tr>
|
|
537
|
+
</table>
|
|
538
|
+
</div>
|
|
539
|
+
|
|
540
|
+
</div>
|
|
541
|
+
|
|
542
|
+
</div>
|
|
543
|
+
|
|
544
|
+
<div id="footer">
|
|
545
|
+
Generated on Tue Oct 16 23:27:35 2012 by
|
|
546
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
547
|
+
0.8.3 (ruby-1.9.3).
|
|
548
|
+
</div>
|
|
549
|
+
|
|
550
|
+
</body>
|
|
551
|
+
</html>
|