lims-core 3.2.3
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.
- checksums.yaml +15 -0
- data/.gitignore +5 -0
- data/.rspec +1 -0
- data/.rvmrc +2 -0
- data/.travis.yml +2 -0
- data/.vimrc +27 -0
- data/.yard_templates/default/layout/html/footer.erb +0 -0
- data/.yardopts +1 -0
- data/Gemfile +54 -0
- data/Gemfile.lock +197 -0
- data/Guardfile +21 -0
- data/Guardfile.tmux +28 -0
- data/README.markdown +67 -0
- data/Rakefile +16 -0
- data/config/database.yml +16 -0
- data/doc/Array.html +116 -0
- data/doc/Array/ArrayLoggerPersistor.html +152 -0
- data/doc/Lims.html +114 -0
- data/doc/Lims/Core.html +178 -0
- data/doc/Lims/Core/Action.html +91 -0
- data/doc/Lims/Core/Actions.html +116 -0
- data/doc/Lims/Core/Actions/Action.html +216 -0
- data/doc/Lims/Core/Actions/Action/AfterEval.html +853 -0
- data/doc/Lims/Core/Actions/Action/InvalidParameters.html +268 -0
- data/doc/Lims/Core/Actions/ActionGroup.html +196 -0
- data/doc/Lims/Core/Actions/ActionGroup/AfterEval.html +315 -0
- data/doc/Lims/Core/Actions/BulkAction.html +224 -0
- data/doc/Lims/Core/Actions/BulkAction/AfterEval.html +253 -0
- data/doc/Lims/Core/Actions/TestActionGroup.html +101 -0
- data/doc/Lims/Core/Actions/TestActionGroup/Action.html +133 -0
- data/doc/Lims/Core/Actions/TestActionGroup/ActionGroup.html +127 -0
- data/doc/Lims/Core/Base.html +287 -0
- data/doc/Lims/Core/Base/AccessibleViaSuper.html +252 -0
- data/doc/Lims/Core/Base/ClassMethod.html +177 -0
- data/doc/Lims/Core/Base/HashString.html +177 -0
- data/doc/Lims/Core/Base/IsArrayOf.html +606 -0
- data/doc/Lims/Core/Base/State.html +130 -0
- data/doc/Lims/Core/Organization.html +113 -0
- data/doc/Lims/Core/Organization/Batch.html +106 -0
- data/doc/Lims/Core/Persistence.html +267 -0
- data/doc/Lims/Core/Persistence/ComparisonFilter.html +318 -0
- data/doc/Lims/Core/Persistence/Filter.html +252 -0
- data/doc/Lims/Core/Persistence/IdentityMap.html +409 -0
- data/doc/Lims/Core/Persistence/IdentityMap/Class.html +144 -0
- data/doc/Lims/Core/Persistence/IdentityMap/DuplicateError.html +126 -0
- data/doc/Lims/Core/Persistence/IdentityMap/DuplicateIdError.html +136 -0
- data/doc/Lims/Core/Persistence/IdentityMap/DuplicateObjectError.html +136 -0
- data/doc/Lims/Core/Persistence/IdentityMapClass.html +133 -0
- data/doc/Lims/Core/Persistence/Logger.html +105 -0
- data/doc/Lims/Core/Persistence/Logger/Persistor.html +334 -0
- data/doc/Lims/Core/Persistence/Logger/Session.html +452 -0
- data/doc/Lims/Core/Persistence/Logger/Store.html +470 -0
- data/doc/Lims/Core/Persistence/MessageBus.html +871 -0
- data/doc/Lims/Core/Persistence/MessageBus/ConnectionError.html +123 -0
- data/doc/Lims/Core/Persistence/MessageBus/InvalidSettingsError.html +122 -0
- data/doc/Lims/Core/Persistence/MultiCriteriaFilter.html +293 -0
- data/doc/Lims/Core/Persistence/PersistAssociationTrait.html +91 -0
- data/doc/Lims/Core/Persistence/PersistableTrait.html +91 -0
- data/doc/Lims/Core/Persistence/Persistor.html +3072 -0
- data/doc/Lims/Core/Persistence/Persistor/DuplicateError.html +205 -0
- data/doc/Lims/Core/Persistence/Persistor/DuplicateIdError.html +147 -0
- data/doc/Lims/Core/Persistence/Persistor/DuplicateObjectError.html +147 -0
- data/doc/Lims/Core/Persistence/PersistorTrait.html +91 -0
- data/doc/Lims/Core/Persistence/ResourceState.html +1738 -0
- data/doc/Lims/Core/Persistence/Search.html +269 -0
- data/doc/Lims/Core/Persistence/Search/CreateSearch.html +251 -0
- data/doc/Lims/Core/Persistence/Search/SearchPersistor.html +240 -0
- data/doc/Lims/Core/Persistence/Search/SearchSequelPersistor.html +396 -0
- data/doc/Lims/Core/Persistence/Sequel.html +117 -0
- data/doc/Lims/Core/Persistence/Sequel/Filters.html +462 -0
- data/doc/Lims/Core/Persistence/Sequel/ForTest.html +101 -0
- data/doc/Lims/Core/Persistence/Sequel/ForTest/Name.html +137 -0
- data/doc/Lims/Core/Persistence/Sequel/ForTest/Name/NamePersitor.html +143 -0
- data/doc/Lims/Core/Persistence/Sequel/Migrations.html +266 -0
- data/doc/Lims/Core/Persistence/Sequel/Persistor.html +665 -0
- data/doc/Lims/Core/Persistence/Sequel/Session.html +501 -0
- data/doc/Lims/Core/Persistence/Sequel/Store.html +417 -0
- data/doc/Lims/Core/Persistence/Session.html +2751 -0
- data/doc/Lims/Core/Persistence/Session/UnmanagedObjectError.html +111 -0
- data/doc/Lims/Core/Persistence/StateGroup.html +696 -0
- data/doc/Lims/Core/Persistence/StateList.html +498 -0
- data/doc/Lims/Core/Persistence/Store.html +695 -0
- data/doc/Lims/Core/Persistence/UuidResource.html +1044 -0
- data/doc/Lims/Core/Persistence/UuidResource/InvalidUuidError.html +111 -0
- data/doc/Lims/Core/Persistence/UuidResource/UuidResourcePersistor.html +337 -0
- data/doc/Lims/Core/Persistence/Uuidable.html +799 -0
- data/doc/Lims/Core/Persistor.html +320 -0
- data/doc/Lims/Core/Resource.html +165 -0
- data/doc/Object.html +228 -0
- data/doc/SessionSpec.html +101 -0
- data/doc/SessionSpec/Model.html +279 -0
- data/doc/SessionSpec/Model/ModelPersistor.html +327 -0
- data/doc/_index.html +732 -0
- data/doc/class_list.html +47 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +55 -0
- data/doc/css/style.css +322 -0
- data/doc/file.README.html +127 -0
- data/doc/file_list.html +49 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +127 -0
- data/doc/js/app.js +205 -0
- data/doc/js/full_list.js +167 -0
- data/doc/js/jquery.js +16 -0
- data/doc/method_list.html +1894 -0
- data/doc/top-level-namespace.html +100 -0
- data/lib/common.rb +18 -0
- data/lib/lims-core.rb +29 -0
- data/lib/lims-core/actions.rb +10 -0
- data/lib/lims-core/actions/action.rb +185 -0
- data/lib/lims-core/actions/action_group.rb +54 -0
- data/lib/lims-core/actions/bulk_action.rb +65 -0
- data/lib/lims-core/base.rb +132 -0
- data/lib/lims-core/helpers.rb +41 -0
- data/lib/lims-core/persistence.rb +15 -0
- data/lib/lims-core/persistence/comparison_filter.rb +54 -0
- data/lib/lims-core/persistence/filter.rb +23 -0
- data/lib/lims-core/persistence/identity_map.rb +55 -0
- data/lib/lims-core/persistence/logger/all.rb +5 -0
- data/lib/lims-core/persistence/logger/persistor.rb +35 -0
- data/lib/lims-core/persistence/logger/session.rb +30 -0
- data/lib/lims-core/persistence/logger/store.rb +37 -0
- data/lib/lims-core/persistence/message_bus.rb +131 -0
- data/lib/lims-core/persistence/multi_criteria_filter.rb +50 -0
- data/lib/lims-core/persistence/persist_association_trait.rb +96 -0
- data/lib/lims-core/persistence/persistable_trait.rb +150 -0
- data/lib/lims-core/persistence/persistor.rb +495 -0
- data/lib/lims-core/persistence/resource_state.rb +157 -0
- data/lib/lims-core/persistence/search.rb +3 -0
- data/lib/lims-core/persistence/search/all.rb +3 -0
- data/lib/lims-core/persistence/search/create_search.rb +55 -0
- data/lib/lims-core/persistence/search/search_persistor.rb +45 -0
- data/lib/lims-core/persistence/search/search_sequel_persistor.rb +40 -0
- data/lib/lims-core/persistence/sequel.rb +14 -0
- data/lib/lims-core/persistence/sequel/filters.rb +106 -0
- data/lib/lims-core/persistence/sequel/migrations.rb +14 -0
- data/lib/lims-core/persistence/sequel/migrations/add_audit_tables.rb +147 -0
- data/lib/lims-core/persistence/sequel/migrations/initial.rb +156 -0
- data/lib/lims-core/persistence/sequel/persistor.rb +200 -0
- data/lib/lims-core/persistence/sequel/session.rb +136 -0
- data/lib/lims-core/persistence/sequel/store.rb +37 -0
- data/lib/lims-core/persistence/session.rb +409 -0
- data/lib/lims-core/persistence/state_group.rb +97 -0
- data/lib/lims-core/persistence/state_list.rb +56 -0
- data/lib/lims-core/persistence/store.rb +73 -0
- data/lib/lims-core/persistence/uuid_resource.rb +115 -0
- data/lib/lims-core/persistence/uuid_resource_persistor.rb +43 -0
- data/lib/lims-core/persistence/uuidable.rb +107 -0
- data/lib/lims-core/resource.rb +21 -0
- data/lib/lims-core/subclass_tracker.rb +30 -0
- data/lib/lims-core/version.rb +5 -0
- data/lims-core.gemspec +40 -0
- data/makefile +52 -0
- data/showoff/core-2012-06-11/core/01_slide.md +237 -0
- data/showoff/core-2012-06-11/core/02_slide.md +110 -0
- data/showoff/core-2012-06-11/custom.css +44 -0
- data/showoff/core-2012-06-11/main/01_slide.md +53 -0
- data/showoff/core-2012-06-11/showoff.json +10 -0
- data/showoff/core-2012-06-11/tp1.tpl +1 -0
- data/spec/actions/action_group_spec.rb +39 -0
- data/spec/actions/spec_helper.rb +1 -0
- data/spec/persistence/identity_map_spec.rb +55 -0
- data/spec/persistence/logger/spec_helper.rb +7 -0
- data/spec/persistence/logger/store_spec.rb +48 -0
- data/spec/persistence/message_bus_spec.rb +76 -0
- data/spec/persistence/sequel/session_spec.rb +125 -0
- data/spec/persistence/sequel/spec_helper.rb +39 -0
- data/spec/persistence/sequel/store_shared.rb +25 -0
- data/spec/persistence/sequel/store_spec.rb +22 -0
- data/spec/persistence/session_spec.rb +199 -0
- data/spec/persistence/spec_helper.rb +2 -0
- data/spec/persistence/uuid_resource_spec.rb +80 -0
- data/spec/spec_helper.rb +10 -0
- data/spec/subclass_tracker_sperc.rb +62 -0
- data/utils/constant_tree.rb +29 -0
- data/utils/stack.rb +48 -0
- metadata +402 -0
|
@@ -0,0 +1,409 @@
|
|
|
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: Lims::Core::Persistence::IdentityMap
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.7.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
|
+
relpath = '../../..';
|
|
19
|
+
if (relpath != '') relpath += '/';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/jquery.js"></script>
|
|
23
|
+
|
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../../js/app.js"></script>
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
</head>
|
|
28
|
+
<body>
|
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<div id="header">
|
|
34
|
+
<div id="menu">
|
|
35
|
+
|
|
36
|
+
<a href="../../../_index.html">Index (I)</a> »
|
|
37
|
+
<span class='title'><span class='object_link'><a href="../../../Lims.html" title="Lims (module)">Lims</a></span></span> » <span class='title'><span class='object_link'><a href="../../Core.html" title="Lims::Core (module)">Core</a></span></span> » <span class='title'><span class='object_link'><a href="../Persistence.html" title="Lims::Core::Persistence (module)">Persistence</a></span></span>
|
|
38
|
+
»
|
|
39
|
+
<span class="title">IdentityMap</span>
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div id="search">
|
|
46
|
+
|
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
|
48
|
+
|
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
|
50
|
+
|
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
<div class="clear"></div>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<iframe id="search_frame"></iframe>
|
|
58
|
+
|
|
59
|
+
<div id="content"><h1>Module: Lims::Core::Persistence::IdentityMap
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
</h1>
|
|
64
|
+
|
|
65
|
+
<dl class="box">
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
<dt class="r1">Included in:</dt>
|
|
74
|
+
<dd class="r1"><span class='object_link'><a href="IdentityMap/Class.html" title="Lims::Core::Persistence::IdentityMap::Class (class)">Class</a></span>, <span class='object_link'><a href="IdentityMapClass.html" title="Lims::Core::Persistence::IdentityMapClass (class)">IdentityMapClass</a></span></dd>
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
<dt class="r2 last">Defined in:</dt>
|
|
79
|
+
<dd class="r2 last">lib/lims-core/persistence/identity_map.rb</dd>
|
|
80
|
+
|
|
81
|
+
</dl>
|
|
82
|
+
<div class="clear"></div>
|
|
83
|
+
|
|
84
|
+
<h2>Overview</h2><div class="docstring">
|
|
85
|
+
<div class="discussion">
|
|
86
|
+
|
|
87
|
+
<p>Mixing giving an identity map behavior ie a map (both way) between id and
|
|
88
|
+
object</p>
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="tags">
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
</div><h2>Defined Under Namespace</h2>
|
|
97
|
+
<p class="children">
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="IdentityMap/Class.html" title="Lims::Core::Persistence::IdentityMap::Class (class)">Class</a></span>, <span class='object_link'><a href="IdentityMap/DuplicateError.html" title="Lims::Core::Persistence::IdentityMap::DuplicateError (class)">DuplicateError</a></span>, <span class='object_link'><a href="IdentityMap/DuplicateIdError.html" title="Lims::Core::Persistence::IdentityMap::DuplicateIdError (class)">DuplicateIdError</a></span>, <span class='object_link'><a href="IdentityMap/DuplicateObjectError.html" title="Lims::Core::Persistence::IdentityMap::DuplicateObjectError (class)">DuplicateObjectError</a></span>
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
</p>
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
<h2>
|
|
113
|
+
Instance Method Summary
|
|
114
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
|
115
|
+
</h2>
|
|
116
|
+
|
|
117
|
+
<ul class="summary">
|
|
118
|
+
|
|
119
|
+
<li class="public ">
|
|
120
|
+
<span class="summary_signature">
|
|
121
|
+
|
|
122
|
+
<a href="#id_for-instance_method" title="#id_for (instance method)">- (Object) <strong>id_for</strong>(object, &block) </a>
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
</span>
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
<span class="summary_desc"><div class='inline'>
|
|
136
|
+
<p>Look for the id associated to an object and yield it to the block if found.</p>
|
|
137
|
+
</div></span>
|
|
138
|
+
|
|
139
|
+
</li>
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
<li class="public ">
|
|
143
|
+
<span class="summary_signature">
|
|
144
|
+
|
|
145
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (IdentityMap) <strong>initialize</strong>(*args, &block) </a>
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
</span>
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
<span class="summary_desc"><div class='inline'>
|
|
159
|
+
<p>A new instance of IdentityMap.</p>
|
|
160
|
+
</div></span>
|
|
161
|
+
|
|
162
|
+
</li>
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
<li class="public ">
|
|
166
|
+
<span class="summary_signature">
|
|
167
|
+
|
|
168
|
+
<a href="#map_id_object-instance_method" title="#map_id_object (instance method)">- (Object) <strong>map_id_object</strong>(id, object) </a>
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
</span>
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
<span class="summary_desc"><div class='inline'>
|
|
182
|
+
<p>bound an id to an object.</p>
|
|
183
|
+
</div></span>
|
|
184
|
+
|
|
185
|
+
</li>
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
<li class="public ">
|
|
189
|
+
<span class="summary_signature">
|
|
190
|
+
|
|
191
|
+
<a href="#object_for-instance_method" title="#object_for (instance method)">- (Object) <strong>object_for</strong>(id, &block) </a>
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
</span>
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
<span class="summary_desc"><div class='inline'>
|
|
205
|
+
<p>Look for the object associated to an object and yield it to the block if
|
|
206
|
+
found.</p>
|
|
207
|
+
</div></span>
|
|
208
|
+
|
|
209
|
+
</li>
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
</ul>
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
<div id="instance_method_details" class="method_details_list">
|
|
218
|
+
<h2>Instance Method Details</h2>
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
<div class="method_details first">
|
|
222
|
+
<p class="signature first" id="id_for-instance_method">
|
|
223
|
+
|
|
224
|
+
- (<tt><span class='object_link'><a href="../../../Object.html" title="Object (class)">Object</a></span></tt>) <strong>id_for</strong>(object, &block)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
</p><div class="docstring">
|
|
229
|
+
<div class="discussion">
|
|
230
|
+
|
|
231
|
+
<p>Look for the id associated to an object and yield it to the block if found.</p>
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
</div>
|
|
235
|
+
</div>
|
|
236
|
+
<div class="tags">
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
</div><table class="source_code">
|
|
240
|
+
<tr>
|
|
241
|
+
<td>
|
|
242
|
+
<pre class="lines">
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
24
|
|
246
|
+
25
|
|
247
|
+
26</pre>
|
|
248
|
+
</td>
|
|
249
|
+
<td>
|
|
250
|
+
<pre class="code"><span class="info file"># File 'lib/lims-core/persistence/identity_map.rb', line 24</span>
|
|
251
|
+
|
|
252
|
+
<span class='kw'>def</span> <span class='id id_for'>id_for</span><span class='lparen'>(</span><span class='id object'>object</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span><span class='rparen'>)</span>
|
|
253
|
+
<span class='ivar'>@object_to_id</span><span class='lbracket'>[</span><span class='id object'>object</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id andtap'>andtap</span><span class='lparen'>(</span><span class='op'>&</span><span class='id block'>block</span><span class='rparen'>)</span>
|
|
254
|
+
<span class='kw'>end</span></pre>
|
|
255
|
+
</td>
|
|
256
|
+
</tr>
|
|
257
|
+
</table>
|
|
258
|
+
</div>
|
|
259
|
+
|
|
260
|
+
<div class="method_details ">
|
|
261
|
+
<p class="signature " id="initialize-instance_method">
|
|
262
|
+
|
|
263
|
+
- (<tt><span class='object_link'><a href="" title="Lims::Core::Persistence::IdentityMap (module)">IdentityMap</a></span></tt>) <strong>initialize</strong>(*args, &block)
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
</p><div class="docstring">
|
|
268
|
+
<div class="discussion">
|
|
269
|
+
|
|
270
|
+
<p>A new instance of IdentityMap</p>
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
</div>
|
|
274
|
+
</div>
|
|
275
|
+
<div class="tags">
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
</div><table class="source_code">
|
|
279
|
+
<tr>
|
|
280
|
+
<td>
|
|
281
|
+
<pre class="lines">
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
43
|
|
285
|
+
44
|
|
286
|
+
45
|
|
287
|
+
46
|
|
288
|
+
47</pre>
|
|
289
|
+
</td>
|
|
290
|
+
<td>
|
|
291
|
+
<pre class="code"><span class="info file"># File 'lib/lims-core/persistence/identity_map.rb', line 43</span>
|
|
292
|
+
|
|
293
|
+
<span class='kw'>def</span> <span class='id initialize'>initialize</span><span class='lparen'>(</span><span class='op'>*</span><span class='id args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span><span class='rparen'>)</span>
|
|
294
|
+
<span class='kw'>super</span><span class='lparen'>(</span><span class='op'>*</span><span class='id args'>args</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span><span class='rparen'>)</span>
|
|
295
|
+
<span class='ivar'>@id_to_object</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
296
|
+
<span class='ivar'>@object_to_id</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
|
297
|
+
<span class='kw'>end</span></pre>
|
|
298
|
+
</td>
|
|
299
|
+
</tr>
|
|
300
|
+
</table>
|
|
301
|
+
</div>
|
|
302
|
+
|
|
303
|
+
<div class="method_details ">
|
|
304
|
+
<p class="signature " id="map_id_object-instance_method">
|
|
305
|
+
|
|
306
|
+
- (<tt><span class='object_link'><a href="../../../Object.html" title="Object (class)">Object</a></span></tt>) <strong>map_id_object</strong>(id, object)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
</p><div class="docstring">
|
|
311
|
+
<div class="discussion">
|
|
312
|
+
|
|
313
|
+
<p>bound an id to an object</p>
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
<div class="tags">
|
|
319
|
+
|
|
320
|
+
<h3>Raises:</h3>
|
|
321
|
+
<ul class="raise">
|
|
322
|
+
|
|
323
|
+
<li>
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
<span class='type'>(<tt><span class='object_link'><a href="IdentityMap/DuplicateIdError.html" title="Lims::Core::Persistence::IdentityMap::DuplicateIdError (class)">DuplicateIdError</a></span></tt>)</span>
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
</li>
|
|
331
|
+
|
|
332
|
+
</ul>
|
|
333
|
+
|
|
334
|
+
</div><table class="source_code">
|
|
335
|
+
<tr>
|
|
336
|
+
<td>
|
|
337
|
+
<pre class="lines">
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
35
|
|
341
|
+
36
|
|
342
|
+
37
|
|
343
|
+
38
|
|
344
|
+
39
|
|
345
|
+
40
|
|
346
|
+
41</pre>
|
|
347
|
+
</td>
|
|
348
|
+
<td>
|
|
349
|
+
<pre class="code"><span class="info file"># File 'lib/lims-core/persistence/identity_map.rb', line 35</span>
|
|
350
|
+
|
|
351
|
+
<span class='kw'>def</span> <span class='id map_id_object'>map_id_object</span><span class='lparen'>(</span><span class='id id'>id</span><span class='comma'>,</span> <span class='id object'>object</span><span class='rparen'>)</span>
|
|
352
|
+
<span class='kw'>return</span> <span class='kw'>nil</span> <span class='kw'>unless</span> <span class='id id'>id</span> <span class='op'>&&</span> <span class='id object'>object</span>
|
|
353
|
+
<span class='id raise'>raise</span> <span class='const'>DuplicateIdError</span><span class='comma'>,</span> <span class='id id'>id</span> <span class='kw'>unless</span> <span class='ivar'>@id_to_object</span><span class='period'>.</span><span class='id fetch'>fetch</span><span class='lparen'>(</span><span class='id id'>id</span><span class='comma'>,</span> <span class='id object'>object</span><span class='rparen'>)</span><span class='period'>.</span><span class='id equal?'>equal?</span> <span class='id object'>object</span>
|
|
354
|
+
<span class='id raise'>raise</span> <span class='const'>DuplicateObjectError</span><span class='comma'>,</span> <span class='id object'>object</span> <span class='kw'>unless</span> <span class='ivar'>@object_to_id</span><span class='period'>.</span><span class='id fetch'>fetch</span><span class='lparen'>(</span><span class='id object'>object</span><span class='comma'>,</span> <span class='id id'>id</span><span class='rparen'>)</span><span class='period'>.</span><span class='id equal?'>equal?</span> <span class='id id'>id</span>
|
|
355
|
+
<span class='ivar'>@id_to_object</span><span class='lbracket'>[</span><span class='id id'>id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id object'>object</span>
|
|
356
|
+
<span class='ivar'>@object_to_id</span><span class='lbracket'>[</span><span class='id object'>object</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id id'>id</span>
|
|
357
|
+
<span class='kw'>end</span></pre>
|
|
358
|
+
</td>
|
|
359
|
+
</tr>
|
|
360
|
+
</table>
|
|
361
|
+
</div>
|
|
362
|
+
|
|
363
|
+
<div class="method_details ">
|
|
364
|
+
<p class="signature " id="object_for-instance_method">
|
|
365
|
+
|
|
366
|
+
- (<tt><span class='object_link'><a href="../../../Object.html" title="Object (class)">Object</a></span></tt>) <strong>object_for</strong>(id, &block)
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
</p><div class="docstring">
|
|
371
|
+
<div class="discussion">
|
|
372
|
+
|
|
373
|
+
<p>Look for the object associated to an object and yield it to the block if
|
|
374
|
+
found.</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
|
+
30
|
|
389
|
+
31
|
|
390
|
+
32</pre>
|
|
391
|
+
</td>
|
|
392
|
+
<td>
|
|
393
|
+
<pre class="code"><span class="info file"># File 'lib/lims-core/persistence/identity_map.rb', line 30</span>
|
|
394
|
+
|
|
395
|
+
<span class='kw'>def</span> <span class='id object_for'>object_for</span><span class='lparen'>(</span><span class='id id'>id</span><span class='comma'>,</span> <span class='op'>&</span><span class='id block'>block</span><span class='rparen'>)</span>
|
|
396
|
+
<span class='ivar'>@id_to_object</span><span class='lbracket'>[</span><span class='id id'>id</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id andtap'>andtap</span><span class='lparen'>(</span><span class='op'>&</span><span class='id block'>block</span><span class='rparen'>)</span>
|
|
397
|
+
<span class='kw'>end</span></pre>
|
|
398
|
+
</td>
|
|
399
|
+
</tr>
|
|
400
|
+
</table>
|
|
401
|
+
</div>
|
|
402
|
+
|
|
403
|
+
</div>
|
|
404
|
+
|
|
405
|
+
</div>
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
</body>
|
|
409
|
+
</html>
|
|
@@ -0,0 +1,144 @@
|
|
|
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: Lims::Core::Persistence::IdentityMap::Class
|
|
8
|
+
|
|
9
|
+
— Documentation by YARD 0.7.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
|
+
relpath = '../../../..';
|
|
19
|
+
if (relpath != '') relpath += '/';
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<script type="text/javascript" charset="utf-8" src="../../../../js/jquery.js"></script>
|
|
23
|
+
|
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../../../js/app.js"></script>
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
</head>
|
|
28
|
+
<body>
|
|
29
|
+
<script type="text/javascript" charset="utf-8">
|
|
30
|
+
if (window.top.frames.main) document.body.className = 'frames';
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<div id="header">
|
|
34
|
+
<div id="menu">
|
|
35
|
+
|
|
36
|
+
<a href="../../../../_index.html">Index (C)</a> »
|
|
37
|
+
<span class='title'><span class='object_link'><a href="../../../../Lims.html" title="Lims (module)">Lims</a></span></span> » <span class='title'><span class='object_link'><a href="../../../Core.html" title="Lims::Core (module)">Core</a></span></span> » <span class='title'><span class='object_link'><a href="../../Persistence.html" title="Lims::Core::Persistence (module)">Persistence</a></span></span> » <span class='title'><span class='object_link'><a href="../IdentityMap.html" title="Lims::Core::Persistence::IdentityMap (module)">IdentityMap</a></span></span>
|
|
38
|
+
»
|
|
39
|
+
<span class="title">Class</span>
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div id="search">
|
|
46
|
+
|
|
47
|
+
<a id="class_list_link" href="#">Class List</a>
|
|
48
|
+
|
|
49
|
+
<a id="method_list_link" href="#">Method List</a>
|
|
50
|
+
|
|
51
|
+
<a id="file_list_link" href="#">File List</a>
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
<div class="clear"></div>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<iframe id="search_frame"></iframe>
|
|
58
|
+
|
|
59
|
+
<div id="content"><h1>Class: Lims::Core::Persistence::IdentityMap::Class
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
</h1>
|
|
64
|
+
|
|
65
|
+
<dl class="box">
|
|
66
|
+
|
|
67
|
+
<dt class="r1">Inherits:</dt>
|
|
68
|
+
<dd class="r1">
|
|
69
|
+
<span class="inheritName"><span class='object_link'><a href="../../../../Object.html" title="Object (class)">Object</a></span></span>
|
|
70
|
+
|
|
71
|
+
<ul class="fullTree">
|
|
72
|
+
<li><span class='object_link'><a href="../../../../Object.html" title="Object (class)">Object</a></span></li>
|
|
73
|
+
|
|
74
|
+
<li class="next">Lims::Core::Persistence::IdentityMap::Class</li>
|
|
75
|
+
|
|
76
|
+
</ul>
|
|
77
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
78
|
+
|
|
79
|
+
</dd>
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
<dt class="r2">Includes:</dt>
|
|
87
|
+
<dd class="r2"><span class='object_link'><a href="../IdentityMap.html" title="Lims::Core::Persistence::IdentityMap (module)">Lims::Core::Persistence::IdentityMap</a></span></dd>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
<dt class="r1 last">Defined in:</dt>
|
|
94
|
+
<dd class="r1 last">lib/lims-core/persistence/identity_map.rb</dd>
|
|
95
|
+
|
|
96
|
+
</dl>
|
|
97
|
+
<div class="clear"></div>
|
|
98
|
+
|
|
99
|
+
<h2>Overview</h2><div class="docstring">
|
|
100
|
+
<div class="discussion">
|
|
101
|
+
|
|
102
|
+
<p>Class version</p>
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
107
|
+
<div class="tags">
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
<h2>Method Summary</h2>
|
|
129
|
+
|
|
130
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="../IdentityMap.html" title="Lims::Core::Persistence::IdentityMap (module)">Lims::Core::Persistence::IdentityMap</a></span></h3>
|
|
131
|
+
<p class="inherited"><span class='object_link'><a href="../IdentityMap.html#id_for-instance_method" title="Lims::Core::Persistence::IdentityMap#id_for (method)">#id_for</a></span>, <span class='object_link'><a href="../IdentityMap.html#initialize-instance_method" title="Lims::Core::Persistence::IdentityMap#initialize (method)">#initialize</a></span>, <span class='object_link'><a href="../IdentityMap.html#map_id_object-instance_method" title="Lims::Core::Persistence::IdentityMap#map_id_object (method)">#map_id_object</a></span>, <span class='object_link'><a href="../IdentityMap.html#object_for-instance_method" title="Lims::Core::Persistence::IdentityMap#object_for (method)">#object_for</a></span></p>
|
|
132
|
+
<div id="constructor_details" class="method_details_list">
|
|
133
|
+
<h2>Constructor Details</h2>
|
|
134
|
+
|
|
135
|
+
<p class="notice">This class inherits a constructor from <span class='object_link'><a href="../IdentityMap.html#initialize-instance_method" title="Lims::Core::Persistence::IdentityMap#initialize (method)">Lims::Core::Persistence::IdentityMap</a></span></p>
|
|
136
|
+
|
|
137
|
+
</div>
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
</div>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
</body>
|
|
144
|
+
</html>
|