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,126 @@
|
|
|
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::RenderOptions
|
|
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 (R)</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">RenderOptions</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::RenderOptions
|
|
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/render_options.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>Container object for render options.</p>
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
</div>
|
|
94
|
+
</div>
|
|
95
|
+
<div class="tags">
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
</div><h2>Defined Under Namespace</h2>
|
|
99
|
+
<p class="children">
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="RenderOptions/Base.html" title="ViewModels::RenderOptions::Base (class)">Base</a></span>, <span class='object_link'><a href="RenderOptions/Partial.html" title="ViewModels::RenderOptions::Partial (class)">Partial</a></span>, <span class='object_link'><a href="RenderOptions/Template.html" title="ViewModels::RenderOptions::Template (class)">Template</a></span>
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
</p>
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
</div>
|
|
118
|
+
|
|
119
|
+
<div id="footer">
|
|
120
|
+
Generated on Tue Oct 16 23:27:34 2012 by
|
|
121
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
122
|
+
0.8.3 (ruby-1.9.3).
|
|
123
|
+
</div>
|
|
124
|
+
|
|
125
|
+
</body>
|
|
126
|
+
</html>
|
|
@@ -0,0 +1,1187 @@
|
|
|
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::RenderOptions::Base
|
|
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 (B)</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="../RenderOptions.html" title="ViewModels::RenderOptions (module)">RenderOptions</a></span></span>
|
|
36
|
+
»
|
|
37
|
+
<span class="title">Base</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::RenderOptions::Base
|
|
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::RenderOptions::Base</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/render_options.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>Base class for Partial and Template.</p>
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
<div class="tags">
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
</div><div id="subclasses">
|
|
114
|
+
<h2>Direct Known Subclasses</h2>
|
|
115
|
+
<p class="children"><span class='object_link'><a href="Partial.html" title="ViewModels::RenderOptions::Partial (class)">Partial</a></span>, <span class='object_link'><a href="Template.html" title="ViewModels::RenderOptions::Template (class)">Template</a></span></p>
|
|
116
|
+
</div>
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
|
122
|
+
<ul class="summary">
|
|
123
|
+
|
|
124
|
+
<li class="public ">
|
|
125
|
+
<span class="summary_signature">
|
|
126
|
+
|
|
127
|
+
<a href="#file-instance_method" title="#file (instance method)">- (Object) <strong>file</strong> </a>
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
</span>
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
<span class="summary_desc"><div class='inline'>
|
|
145
|
+
<p>The different attributes used to generate render options.</p>
|
|
146
|
+
</div></span>
|
|
147
|
+
|
|
148
|
+
</li>
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
<li class="public ">
|
|
152
|
+
<span class="summary_signature">
|
|
153
|
+
|
|
154
|
+
<a href="#format-instance_method" title="#format (instance method)">- (Object) <strong>format</strong> </a>
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
</span>
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
<span class="summary_desc"><div class='inline'>
|
|
172
|
+
<p>The different attributes used to generate render options.</p>
|
|
173
|
+
</div></span>
|
|
174
|
+
|
|
175
|
+
</li>
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
<li class="public ">
|
|
179
|
+
<span class="summary_signature">
|
|
180
|
+
|
|
181
|
+
<a href="#name-instance_method" title="#name (instance method)">- (Object) <strong>name</strong> </a>
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
</span>
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
<span class="summary_desc"><div class='inline'>
|
|
199
|
+
<p>The different attributes used to generate render options.</p>
|
|
200
|
+
</div></span>
|
|
201
|
+
|
|
202
|
+
</li>
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
<li class="public ">
|
|
206
|
+
<span class="summary_signature">
|
|
207
|
+
|
|
208
|
+
<a href="#path-instance_method" title="#path (instance method)">- (Object) <strong>path</strong> </a>
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
</span>
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
<span class="summary_desc"><div class='inline'>
|
|
226
|
+
<p>The different attributes used to generate render options.</p>
|
|
227
|
+
</div></span>
|
|
228
|
+
|
|
229
|
+
</li>
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
<li class="public ">
|
|
233
|
+
<span class="summary_signature">
|
|
234
|
+
|
|
235
|
+
<a href="#prefix-instance_method" title="#prefix (instance method)">- (Object) <strong>prefix</strong> </a>
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
</span>
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
<span class="summary_desc"><div class='inline'>
|
|
253
|
+
<p>The different attributes used to generate render options.</p>
|
|
254
|
+
</div></span>
|
|
255
|
+
|
|
256
|
+
</li>
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
<li class="public ">
|
|
260
|
+
<span class="summary_signature">
|
|
261
|
+
|
|
262
|
+
<a href="#view_model-instance_method" title="#view_model (instance method)">- (Object) <strong>view_model</strong> </a>
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
</span>
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
<span class="summary_desc"><div class='inline'>
|
|
280
|
+
<p>The different attributes used to generate render options.</p>
|
|
281
|
+
</div></span>
|
|
282
|
+
|
|
283
|
+
</li>
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
</ul>
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
<h2>
|
|
293
|
+
Instance Method Summary
|
|
294
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
|
295
|
+
</h2>
|
|
296
|
+
|
|
297
|
+
<ul class="summary">
|
|
298
|
+
|
|
299
|
+
<li class="public ">
|
|
300
|
+
<span class="summary_signature">
|
|
301
|
+
|
|
302
|
+
<a href="#error_format-instance_method" title="#error_format (instance method)">- (String) <strong>error_format</strong> </a>
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
</span>
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
<span class="summary_desc"><div class='inline'>
|
|
317
|
+
<p>The format when trying to render.</p>
|
|
318
|
+
</div></span>
|
|
319
|
+
|
|
320
|
+
</li>
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
<li class="public ">
|
|
324
|
+
<span class="summary_signature">
|
|
325
|
+
|
|
326
|
+
<a href="#error_message-instance_method" title="#error_message (instance method)">- (Object) <strong>error_message</strong> </a>
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
</span>
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
<span class="summary_desc"><div class='inline'>
|
|
341
|
+
<p>Generate a suitable error message for the error options.</p>
|
|
342
|
+
</div></span>
|
|
343
|
+
|
|
344
|
+
</li>
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
<li class="public ">
|
|
348
|
+
<span class="summary_signature">
|
|
349
|
+
|
|
350
|
+
<a href="#error_path-instance_method" title="#error_path (instance method)">- (String) <strong>error_path</strong> </a>
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
</span>
|
|
355
|
+
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
<span class="summary_desc"><div class='inline'>
|
|
365
|
+
<p>The error path, always returns a string.</p>
|
|
366
|
+
</div></span>
|
|
367
|
+
|
|
368
|
+
</li>
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
<li class="public ">
|
|
372
|
+
<span class="summary_signature">
|
|
373
|
+
|
|
374
|
+
<a href="#format%21-instance_method" title="#format! (instance method)">- (Object) <strong>format!</strong>(view) </a>
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
</span>
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
<span class="summary_desc"><div class='inline'></div></span>
|
|
389
|
+
|
|
390
|
+
</li>
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
<li class="public ">
|
|
394
|
+
<span class="summary_signature">
|
|
395
|
+
|
|
396
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Base) <strong>initialize</strong>(prefix, name, options) </a>
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
</span>
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
<span class="note title constructor">constructor</span>
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
|
|
412
|
+
<span class="summary_desc"><div class='inline'>
|
|
413
|
+
<p>Initialize Render Options.</p>
|
|
414
|
+
</div></span>
|
|
415
|
+
|
|
416
|
+
</li>
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
<li class="public ">
|
|
420
|
+
<span class="summary_signature">
|
|
421
|
+
|
|
422
|
+
<a href="#path_key-instance_method" title="#path_key (instance method)">- (Object) <strong>path_key</strong> </a>
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
</span>
|
|
427
|
+
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
<span class="summary_desc"><div class='inline'>
|
|
437
|
+
<p>Used for caching.</p>
|
|
438
|
+
</div></span>
|
|
439
|
+
|
|
440
|
+
</li>
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
<li class="public ">
|
|
444
|
+
<span class="summary_signature">
|
|
445
|
+
|
|
446
|
+
<a href="#to_render_options-instance_method" title="#to_render_options (instance method)">- (Hash) <strong>to_render_options</strong> </a>
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
|
|
450
|
+
</span>
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
<span class="summary_desc"><div class='inline'>
|
|
461
|
+
<p>Used when rendering.</p>
|
|
462
|
+
</div></span>
|
|
463
|
+
|
|
464
|
+
</li>
|
|
465
|
+
|
|
466
|
+
|
|
467
|
+
</ul>
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
<div id="constructor_details" class="method_details_list">
|
|
471
|
+
<h2>Constructor Details</h2>
|
|
472
|
+
|
|
473
|
+
<div class="method_details first">
|
|
474
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
475
|
+
|
|
476
|
+
- (<tt><span class='object_link'><a href="" title="ViewModels::RenderOptions::Base (class)">Base</a></span></tt>) <strong>initialize</strong>(prefix, name, options)
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
</h3><div class="docstring">
|
|
483
|
+
<div class="discussion">
|
|
484
|
+
|
|
485
|
+
<p>Initialize Render Options</p>
|
|
486
|
+
|
|
487
|
+
|
|
488
|
+
</div>
|
|
489
|
+
</div>
|
|
490
|
+
<div class="tags">
|
|
491
|
+
<p class="tag_title">Parameters:</p>
|
|
492
|
+
<ul class="param">
|
|
493
|
+
|
|
494
|
+
<li>
|
|
495
|
+
|
|
496
|
+
<span class='name'>prefix</span>
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
—
|
|
504
|
+
<div class='inline'>
|
|
505
|
+
<p>The prefix for rendering</p>
|
|
506
|
+
</div>
|
|
507
|
+
|
|
508
|
+
</li>
|
|
509
|
+
|
|
510
|
+
<li>
|
|
511
|
+
|
|
512
|
+
<span class='name'>name</span>
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
—
|
|
520
|
+
<div class='inline'>
|
|
521
|
+
<p>The template name</p>
|
|
522
|
+
</div>
|
|
523
|
+
|
|
524
|
+
</li>
|
|
525
|
+
|
|
526
|
+
<li>
|
|
527
|
+
|
|
528
|
+
<span class='name'>options</span>
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
—
|
|
536
|
+
<div class='inline'>
|
|
537
|
+
<p>The render options as a hash</p>
|
|
538
|
+
</div>
|
|
539
|
+
|
|
540
|
+
</li>
|
|
541
|
+
|
|
542
|
+
</ul>
|
|
543
|
+
|
|
544
|
+
|
|
545
|
+
</div><table class="source_code">
|
|
546
|
+
<tr>
|
|
547
|
+
<td>
|
|
548
|
+
<pre class="lines">
|
|
549
|
+
|
|
550
|
+
|
|
551
|
+
20
|
|
552
|
+
21
|
|
553
|
+
22
|
|
554
|
+
23
|
|
555
|
+
24
|
|
556
|
+
25</pre>
|
|
557
|
+
</td>
|
|
558
|
+
<td>
|
|
559
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/render_options.rb', line 20</span>
|
|
560
|
+
|
|
561
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span> <span class='id identifier rubyid_prefix'>prefix</span><span class='comma'>,</span> <span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span>
|
|
562
|
+
<span class='ivar'>@prefix</span> <span class='op'>=</span> <span class='id identifier rubyid_prefix'>prefix</span>
|
|
563
|
+
<span class='ivar'>@options</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span>
|
|
564
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_template_name'>template_name</span> <span class='op'>=</span> <span class='id identifier rubyid_deoptionize'>deoptionize</span> <span class='id identifier rubyid_name'>name</span>
|
|
565
|
+
<span class='ivar'>@format</span> <span class='op'>=</span> <span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span> <span class='symbol'>:format</span>
|
|
566
|
+
<span class='kw'>end</span></pre>
|
|
567
|
+
</td>
|
|
568
|
+
</tr>
|
|
569
|
+
</table>
|
|
570
|
+
</div>
|
|
571
|
+
|
|
572
|
+
</div>
|
|
573
|
+
|
|
574
|
+
<div id="instance_attr_details" class="attr_details">
|
|
575
|
+
<h2>Instance Attribute Details</h2>
|
|
576
|
+
|
|
577
|
+
|
|
578
|
+
<span id="file=-instance_method"></span>
|
|
579
|
+
<div class="method_details first">
|
|
580
|
+
<h3 class="signature first" id="file-instance_method">
|
|
581
|
+
|
|
582
|
+
- (<tt>Object</tt>) <strong>file</strong>
|
|
583
|
+
|
|
584
|
+
|
|
585
|
+
|
|
586
|
+
|
|
587
|
+
|
|
588
|
+
</h3><div class="docstring">
|
|
589
|
+
<div class="discussion">
|
|
590
|
+
|
|
591
|
+
<p>The different attributes used to generate render options</p>
|
|
592
|
+
|
|
593
|
+
|
|
594
|
+
</div>
|
|
595
|
+
</div>
|
|
596
|
+
<div class="tags">
|
|
597
|
+
|
|
598
|
+
|
|
599
|
+
</div><table class="source_code">
|
|
600
|
+
<tr>
|
|
601
|
+
<td>
|
|
602
|
+
<pre class="lines">
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
13
|
|
606
|
+
14
|
|
607
|
+
15</pre>
|
|
608
|
+
</td>
|
|
609
|
+
<td>
|
|
610
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/render_options.rb', line 13</span>
|
|
611
|
+
|
|
612
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_file'>file</span>
|
|
613
|
+
<span class='ivar'>@file</span>
|
|
614
|
+
<span class='kw'>end</span></pre>
|
|
615
|
+
</td>
|
|
616
|
+
</tr>
|
|
617
|
+
</table>
|
|
618
|
+
</div>
|
|
619
|
+
|
|
620
|
+
|
|
621
|
+
<span id="format=-instance_method"></span>
|
|
622
|
+
<div class="method_details ">
|
|
623
|
+
<h3 class="signature " id="format-instance_method">
|
|
624
|
+
|
|
625
|
+
- (<tt>Object</tt>) <strong>format</strong>
|
|
626
|
+
|
|
627
|
+
|
|
628
|
+
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
</h3><div class="docstring">
|
|
632
|
+
<div class="discussion">
|
|
633
|
+
|
|
634
|
+
<p>The different attributes used to generate render options</p>
|
|
635
|
+
|
|
636
|
+
|
|
637
|
+
</div>
|
|
638
|
+
</div>
|
|
639
|
+
<div class="tags">
|
|
640
|
+
|
|
641
|
+
|
|
642
|
+
</div><table class="source_code">
|
|
643
|
+
<tr>
|
|
644
|
+
<td>
|
|
645
|
+
<pre class="lines">
|
|
646
|
+
|
|
647
|
+
|
|
648
|
+
13
|
|
649
|
+
14
|
|
650
|
+
15</pre>
|
|
651
|
+
</td>
|
|
652
|
+
<td>
|
|
653
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/render_options.rb', line 13</span>
|
|
654
|
+
|
|
655
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_format'>format</span>
|
|
656
|
+
<span class='ivar'>@format</span>
|
|
657
|
+
<span class='kw'>end</span></pre>
|
|
658
|
+
</td>
|
|
659
|
+
</tr>
|
|
660
|
+
</table>
|
|
661
|
+
</div>
|
|
662
|
+
|
|
663
|
+
|
|
664
|
+
<span id="name=-instance_method"></span>
|
|
665
|
+
<div class="method_details ">
|
|
666
|
+
<h3 class="signature " id="name-instance_method">
|
|
667
|
+
|
|
668
|
+
- (<tt>Object</tt>) <strong>name</strong>
|
|
669
|
+
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
</h3><div class="docstring">
|
|
675
|
+
<div class="discussion">
|
|
676
|
+
|
|
677
|
+
<p>The different attributes used to generate render options</p>
|
|
678
|
+
|
|
679
|
+
|
|
680
|
+
</div>
|
|
681
|
+
</div>
|
|
682
|
+
<div class="tags">
|
|
683
|
+
|
|
684
|
+
|
|
685
|
+
</div><table class="source_code">
|
|
686
|
+
<tr>
|
|
687
|
+
<td>
|
|
688
|
+
<pre class="lines">
|
|
689
|
+
|
|
690
|
+
|
|
691
|
+
13
|
|
692
|
+
14
|
|
693
|
+
15</pre>
|
|
694
|
+
</td>
|
|
695
|
+
<td>
|
|
696
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/render_options.rb', line 13</span>
|
|
697
|
+
|
|
698
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
|
|
699
|
+
<span class='ivar'>@name</span>
|
|
700
|
+
<span class='kw'>end</span></pre>
|
|
701
|
+
</td>
|
|
702
|
+
</tr>
|
|
703
|
+
</table>
|
|
704
|
+
</div>
|
|
705
|
+
|
|
706
|
+
|
|
707
|
+
<span id="path=-instance_method"></span>
|
|
708
|
+
<div class="method_details ">
|
|
709
|
+
<h3 class="signature " id="path-instance_method">
|
|
710
|
+
|
|
711
|
+
- (<tt>Object</tt>) <strong>path</strong>
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
</h3><div class="docstring">
|
|
718
|
+
<div class="discussion">
|
|
719
|
+
|
|
720
|
+
<p>The different attributes used to generate render options</p>
|
|
721
|
+
|
|
722
|
+
|
|
723
|
+
</div>
|
|
724
|
+
</div>
|
|
725
|
+
<div class="tags">
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
</div><table class="source_code">
|
|
729
|
+
<tr>
|
|
730
|
+
<td>
|
|
731
|
+
<pre class="lines">
|
|
732
|
+
|
|
733
|
+
|
|
734
|
+
13
|
|
735
|
+
14
|
|
736
|
+
15</pre>
|
|
737
|
+
</td>
|
|
738
|
+
<td>
|
|
739
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/render_options.rb', line 13</span>
|
|
740
|
+
|
|
741
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_path'>path</span>
|
|
742
|
+
<span class='ivar'>@path</span>
|
|
743
|
+
<span class='kw'>end</span></pre>
|
|
744
|
+
</td>
|
|
745
|
+
</tr>
|
|
746
|
+
</table>
|
|
747
|
+
</div>
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
<span id="prefix=-instance_method"></span>
|
|
751
|
+
<div class="method_details ">
|
|
752
|
+
<h3 class="signature " id="prefix-instance_method">
|
|
753
|
+
|
|
754
|
+
- (<tt>Object</tt>) <strong>prefix</strong>
|
|
755
|
+
|
|
756
|
+
|
|
757
|
+
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
</h3><div class="docstring">
|
|
761
|
+
<div class="discussion">
|
|
762
|
+
|
|
763
|
+
<p>The different attributes used to generate render options</p>
|
|
764
|
+
|
|
765
|
+
|
|
766
|
+
</div>
|
|
767
|
+
</div>
|
|
768
|
+
<div class="tags">
|
|
769
|
+
|
|
770
|
+
|
|
771
|
+
</div><table class="source_code">
|
|
772
|
+
<tr>
|
|
773
|
+
<td>
|
|
774
|
+
<pre class="lines">
|
|
775
|
+
|
|
776
|
+
|
|
777
|
+
13
|
|
778
|
+
14
|
|
779
|
+
15</pre>
|
|
780
|
+
</td>
|
|
781
|
+
<td>
|
|
782
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/render_options.rb', line 13</span>
|
|
783
|
+
|
|
784
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_prefix'>prefix</span>
|
|
785
|
+
<span class='ivar'>@prefix</span>
|
|
786
|
+
<span class='kw'>end</span></pre>
|
|
787
|
+
</td>
|
|
788
|
+
</tr>
|
|
789
|
+
</table>
|
|
790
|
+
</div>
|
|
791
|
+
|
|
792
|
+
|
|
793
|
+
<span id="view_model=-instance_method"></span>
|
|
794
|
+
<div class="method_details ">
|
|
795
|
+
<h3 class="signature " id="view_model-instance_method">
|
|
796
|
+
|
|
797
|
+
- (<tt>Object</tt>) <strong>view_model</strong>
|
|
798
|
+
|
|
799
|
+
|
|
800
|
+
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
</h3><div class="docstring">
|
|
804
|
+
<div class="discussion">
|
|
805
|
+
|
|
806
|
+
<p>The different attributes used to generate render options</p>
|
|
807
|
+
|
|
808
|
+
|
|
809
|
+
</div>
|
|
810
|
+
</div>
|
|
811
|
+
<div class="tags">
|
|
812
|
+
|
|
813
|
+
|
|
814
|
+
</div><table class="source_code">
|
|
815
|
+
<tr>
|
|
816
|
+
<td>
|
|
817
|
+
<pre class="lines">
|
|
818
|
+
|
|
819
|
+
|
|
820
|
+
13
|
|
821
|
+
14
|
|
822
|
+
15</pre>
|
|
823
|
+
</td>
|
|
824
|
+
<td>
|
|
825
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/render_options.rb', line 13</span>
|
|
826
|
+
|
|
827
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_view_model'>view_model</span>
|
|
828
|
+
<span class='ivar'>@view_model</span>
|
|
829
|
+
<span class='kw'>end</span></pre>
|
|
830
|
+
</td>
|
|
831
|
+
</tr>
|
|
832
|
+
</table>
|
|
833
|
+
</div>
|
|
834
|
+
|
|
835
|
+
</div>
|
|
836
|
+
|
|
837
|
+
|
|
838
|
+
<div id="instance_method_details" class="method_details_list">
|
|
839
|
+
<h2>Instance Method Details</h2>
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
<div class="method_details first">
|
|
843
|
+
<h3 class="signature first" id="error_format-instance_method">
|
|
844
|
+
|
|
845
|
+
- (<tt>String</tt>) <strong>error_format</strong>
|
|
846
|
+
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
|
|
851
|
+
</h3><div class="docstring">
|
|
852
|
+
<div class="discussion">
|
|
853
|
+
|
|
854
|
+
<p>The format when trying to render</p>
|
|
855
|
+
|
|
856
|
+
|
|
857
|
+
</div>
|
|
858
|
+
</div>
|
|
859
|
+
<div class="tags">
|
|
860
|
+
|
|
861
|
+
<p class="tag_title">Returns:</p>
|
|
862
|
+
<ul class="return">
|
|
863
|
+
|
|
864
|
+
<li>
|
|
865
|
+
|
|
866
|
+
|
|
867
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
868
|
+
|
|
869
|
+
|
|
870
|
+
|
|
871
|
+
—
|
|
872
|
+
<div class='inline'>
|
|
873
|
+
<p>the render format</p>
|
|
874
|
+
</div>
|
|
875
|
+
|
|
876
|
+
</li>
|
|
877
|
+
|
|
878
|
+
</ul>
|
|
879
|
+
|
|
880
|
+
</div><table class="source_code">
|
|
881
|
+
<tr>
|
|
882
|
+
<td>
|
|
883
|
+
<pre class="lines">
|
|
884
|
+
|
|
885
|
+
|
|
886
|
+
44
|
|
887
|
+
45
|
|
888
|
+
46
|
|
889
|
+
47</pre>
|
|
890
|
+
</td>
|
|
891
|
+
<td>
|
|
892
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/render_options.rb', line 44</span>
|
|
893
|
+
|
|
894
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error_format'>error_format</span>
|
|
895
|
+
<span class='id identifier rubyid_format'>format</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span>
|
|
896
|
+
<span class='id identifier rubyid_format'>format</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>format </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_format'>format</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>default format</span><span class='tstring_end'>"</span></span>
|
|
897
|
+
<span class='kw'>end</span></pre>
|
|
898
|
+
</td>
|
|
899
|
+
</tr>
|
|
900
|
+
</table>
|
|
901
|
+
</div>
|
|
902
|
+
|
|
903
|
+
<div class="method_details ">
|
|
904
|
+
<h3 class="signature " id="error_message-instance_method">
|
|
905
|
+
|
|
906
|
+
- (<tt>Object</tt>) <strong>error_message</strong>
|
|
907
|
+
|
|
908
|
+
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
</h3><div class="docstring">
|
|
913
|
+
<div class="discussion">
|
|
914
|
+
|
|
915
|
+
<p>Generate a suitable error message for the error options.</p>
|
|
916
|
+
|
|
917
|
+
|
|
918
|
+
</div>
|
|
919
|
+
</div>
|
|
920
|
+
<div class="tags">
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
</div><table class="source_code">
|
|
924
|
+
<tr>
|
|
925
|
+
<td>
|
|
926
|
+
<pre class="lines">
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
29
|
|
930
|
+
30
|
|
931
|
+
31</pre>
|
|
932
|
+
</td>
|
|
933
|
+
<td>
|
|
934
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/render_options.rb', line 29</span>
|
|
935
|
+
|
|
936
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error_message'>error_message</span>
|
|
937
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>'</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error_path'>error_path</span><span class='rbrace'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_name'>name</span><span class='rbrace'>}</span><span class='tstring_content'>' with </span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_error_format'>error_format</span><span class='rbrace'>}</span><span class='tstring_end'>"</span></span>
|
|
938
|
+
<span class='kw'>end</span></pre>
|
|
939
|
+
</td>
|
|
940
|
+
</tr>
|
|
941
|
+
</table>
|
|
942
|
+
</div>
|
|
943
|
+
|
|
944
|
+
<div class="method_details ">
|
|
945
|
+
<h3 class="signature " id="error_path-instance_method">
|
|
946
|
+
|
|
947
|
+
- (<tt>String</tt>) <strong>error_path</strong>
|
|
948
|
+
|
|
949
|
+
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
|
|
953
|
+
</h3><div class="docstring">
|
|
954
|
+
<div class="discussion">
|
|
955
|
+
|
|
956
|
+
<p>The error path, always returns a string</p>
|
|
957
|
+
|
|
958
|
+
|
|
959
|
+
</div>
|
|
960
|
+
</div>
|
|
961
|
+
<div class="tags">
|
|
962
|
+
|
|
963
|
+
<p class="tag_title">Returns:</p>
|
|
964
|
+
<ul class="return">
|
|
965
|
+
|
|
966
|
+
<li>
|
|
967
|
+
|
|
968
|
+
|
|
969
|
+
<span class='type'>(<tt>String</tt>)</span>
|
|
970
|
+
|
|
971
|
+
|
|
972
|
+
|
|
973
|
+
—
|
|
974
|
+
<div class='inline'>
|
|
975
|
+
<p>The error path</p>
|
|
976
|
+
</div>
|
|
977
|
+
|
|
978
|
+
</li>
|
|
979
|
+
|
|
980
|
+
</ul>
|
|
981
|
+
|
|
982
|
+
</div><table class="source_code">
|
|
983
|
+
<tr>
|
|
984
|
+
<td>
|
|
985
|
+
<pre class="lines">
|
|
986
|
+
|
|
987
|
+
|
|
988
|
+
36
|
|
989
|
+
37
|
|
990
|
+
38
|
|
991
|
+
39</pre>
|
|
992
|
+
</td>
|
|
993
|
+
<td>
|
|
994
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/render_options.rb', line 36</span>
|
|
995
|
+
|
|
996
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_error_path'>error_path</span>
|
|
997
|
+
<span class='id identifier rubyid_path'>path</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span>
|
|
998
|
+
<span class='id identifier rubyid_path'>path</span> <span class='op'>?</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path'>path</span><span class='rbrace'>}</span><span class='tstring_content'>/</span><span class='tstring_end'>"</span></span> <span class='op'>:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span>
|
|
999
|
+
<span class='kw'>end</span></pre>
|
|
1000
|
+
</td>
|
|
1001
|
+
</tr>
|
|
1002
|
+
</table>
|
|
1003
|
+
</div>
|
|
1004
|
+
|
|
1005
|
+
<div class="method_details ">
|
|
1006
|
+
<h3 class="signature " id="format!-instance_method">
|
|
1007
|
+
|
|
1008
|
+
- (<tt>Object</tt>) <strong>format!</strong>(view)
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
</h3><div class="docstring">
|
|
1015
|
+
<div class="discussion">
|
|
1016
|
+
|
|
1017
|
+
<div class="note todo">
|
|
1018
|
+
<strong>TODO:</strong>
|
|
1019
|
+
<div class='inline'>
|
|
1020
|
+
<p>Rails specific.</p>
|
|
1021
|
+
</div>
|
|
1022
|
+
</div>
|
|
1023
|
+
|
|
1024
|
+
|
|
1025
|
+
|
|
1026
|
+
</div>
|
|
1027
|
+
</div>
|
|
1028
|
+
<div class="tags">
|
|
1029
|
+
<p class="tag_title">Parameters:</p>
|
|
1030
|
+
<ul class="param">
|
|
1031
|
+
|
|
1032
|
+
<li>
|
|
1033
|
+
|
|
1034
|
+
<span class='name'>view</span>
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
<span class='type'>(<tt>ActionView</tt>)</span>
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
|
|
1041
|
+
—
|
|
1042
|
+
<div class='inline'>
|
|
1043
|
+
<p>The view to render</p>
|
|
1044
|
+
</div>
|
|
1045
|
+
|
|
1046
|
+
</li>
|
|
1047
|
+
|
|
1048
|
+
</ul>
|
|
1049
|
+
|
|
1050
|
+
|
|
1051
|
+
</div><table class="source_code">
|
|
1052
|
+
<tr>
|
|
1053
|
+
<td>
|
|
1054
|
+
<pre class="lines">
|
|
1055
|
+
|
|
1056
|
+
|
|
1057
|
+
61
|
|
1058
|
+
62
|
|
1059
|
+
63</pre>
|
|
1060
|
+
</td>
|
|
1061
|
+
<td>
|
|
1062
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/render_options.rb', line 61</span>
|
|
1063
|
+
|
|
1064
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_format!'>format!</span> <span class='id identifier rubyid_view'>view</span>
|
|
1065
|
+
<span class='id identifier rubyid_view'>view</span><span class='period'>.</span><span class='id identifier rubyid_template_format'>template_format</span> <span class='op'>=</span> <span class='ivar'>@format</span> <span class='kw'>if</span> <span class='ivar'>@format</span>
|
|
1066
|
+
<span class='kw'>end</span></pre>
|
|
1067
|
+
</td>
|
|
1068
|
+
</tr>
|
|
1069
|
+
</table>
|
|
1070
|
+
</div>
|
|
1071
|
+
|
|
1072
|
+
<div class="method_details ">
|
|
1073
|
+
<h3 class="signature " id="path_key-instance_method">
|
|
1074
|
+
|
|
1075
|
+
- (<tt>Object</tt>) <strong>path_key</strong>
|
|
1076
|
+
|
|
1077
|
+
|
|
1078
|
+
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
</h3><div class="docstring">
|
|
1082
|
+
<div class="discussion">
|
|
1083
|
+
|
|
1084
|
+
<p>Used for caching.</p>
|
|
1085
|
+
|
|
1086
|
+
|
|
1087
|
+
</div>
|
|
1088
|
+
</div>
|
|
1089
|
+
<div class="tags">
|
|
1090
|
+
|
|
1091
|
+
|
|
1092
|
+
</div><table class="source_code">
|
|
1093
|
+
<tr>
|
|
1094
|
+
<td>
|
|
1095
|
+
<pre class="lines">
|
|
1096
|
+
|
|
1097
|
+
|
|
1098
|
+
67
|
|
1099
|
+
68
|
|
1100
|
+
69</pre>
|
|
1101
|
+
</td>
|
|
1102
|
+
<td>
|
|
1103
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/render_options.rb', line 67</span>
|
|
1104
|
+
|
|
1105
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_path_key'>path_key</span>
|
|
1106
|
+
<span class='lbracket'>[</span><span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='comma'>,</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_format'>format</span><span class='rbracket'>]</span>
|
|
1107
|
+
<span class='kw'>end</span></pre>
|
|
1108
|
+
</td>
|
|
1109
|
+
</tr>
|
|
1110
|
+
</table>
|
|
1111
|
+
</div>
|
|
1112
|
+
|
|
1113
|
+
<div class="method_details ">
|
|
1114
|
+
<h3 class="signature " id="to_render_options-instance_method">
|
|
1115
|
+
|
|
1116
|
+
- (<tt>Hash</tt>) <strong>to_render_options</strong>
|
|
1117
|
+
|
|
1118
|
+
|
|
1119
|
+
|
|
1120
|
+
|
|
1121
|
+
|
|
1122
|
+
</h3><div class="docstring">
|
|
1123
|
+
<div class="discussion">
|
|
1124
|
+
|
|
1125
|
+
<p>Used when rendering.</p>
|
|
1126
|
+
|
|
1127
|
+
|
|
1128
|
+
</div>
|
|
1129
|
+
</div>
|
|
1130
|
+
<div class="tags">
|
|
1131
|
+
|
|
1132
|
+
<p class="tag_title">Returns:</p>
|
|
1133
|
+
<ul class="return">
|
|
1134
|
+
|
|
1135
|
+
<li>
|
|
1136
|
+
|
|
1137
|
+
|
|
1138
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
|
1139
|
+
|
|
1140
|
+
|
|
1141
|
+
|
|
1142
|
+
—
|
|
1143
|
+
<div class='inline'>
|
|
1144
|
+
<p>The render options</p>
|
|
1145
|
+
</div>
|
|
1146
|
+
|
|
1147
|
+
</li>
|
|
1148
|
+
|
|
1149
|
+
</ul>
|
|
1150
|
+
|
|
1151
|
+
</div><table class="source_code">
|
|
1152
|
+
<tr>
|
|
1153
|
+
<td>
|
|
1154
|
+
<pre class="lines">
|
|
1155
|
+
|
|
1156
|
+
|
|
1157
|
+
52
|
|
1158
|
+
53
|
|
1159
|
+
54
|
|
1160
|
+
55
|
|
1161
|
+
56</pre>
|
|
1162
|
+
</td>
|
|
1163
|
+
<td>
|
|
1164
|
+
<pre class="code"><span class="info file"># File 'lib/view_models/render_options.rb', line 52</span>
|
|
1165
|
+
|
|
1166
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_render_options'>to_render_options</span>
|
|
1167
|
+
<span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:locals</span><span class='rbracket'>]</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
1168
|
+
<span class='ivar'>@options</span><span class='lbracket'>[</span><span class='symbol'>:locals</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_reverse_merge!'>reverse_merge!</span> <span class='symbol'>:view_model</span> <span class='op'>=></span> <span class='id identifier rubyid_view_model'>view_model</span>
|
|
1169
|
+
<span class='ivar'>@options</span><span class='period'>.</span><span class='id identifier rubyid_reverse_merge'>reverse_merge</span> <span class='symbol'>:file</span> <span class='op'>=></span> <span class='id identifier rubyid_file'>file</span>
|
|
1170
|
+
<span class='kw'>end</span></pre>
|
|
1171
|
+
</td>
|
|
1172
|
+
</tr>
|
|
1173
|
+
</table>
|
|
1174
|
+
</div>
|
|
1175
|
+
|
|
1176
|
+
</div>
|
|
1177
|
+
|
|
1178
|
+
</div>
|
|
1179
|
+
|
|
1180
|
+
<div id="footer">
|
|
1181
|
+
Generated on Tue Oct 16 23:27:35 2012 by
|
|
1182
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1183
|
+
0.8.3 (ruby-1.9.3).
|
|
1184
|
+
</div>
|
|
1185
|
+
|
|
1186
|
+
</body>
|
|
1187
|
+
</html>
|