adept_dynamoid 0.5.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. data/.document +5 -0
  2. data/.rspec +1 -0
  3. data/Dynamoid.gemspec +193 -0
  4. data/Gemfile +23 -0
  5. data/Gemfile.lock +86 -0
  6. data/LICENSE.txt +20 -0
  7. data/README.markdown +265 -0
  8. data/Rakefile +62 -0
  9. data/VERSION +1 -0
  10. data/doc/.nojekyll +0 -0
  11. data/doc/Dynamoid.html +312 -0
  12. data/doc/Dynamoid/Adapter.html +1385 -0
  13. data/doc/Dynamoid/Adapter/AwsSdk.html +1585 -0
  14. data/doc/Dynamoid/Adapter/Local.html +1574 -0
  15. data/doc/Dynamoid/Associations.html +131 -0
  16. data/doc/Dynamoid/Associations/Association.html +794 -0
  17. data/doc/Dynamoid/Associations/BelongsTo.html +158 -0
  18. data/doc/Dynamoid/Associations/ClassMethods.html +723 -0
  19. data/doc/Dynamoid/Associations/HasAndBelongsToMany.html +164 -0
  20. data/doc/Dynamoid/Associations/HasMany.html +164 -0
  21. data/doc/Dynamoid/Associations/HasOne.html +158 -0
  22. data/doc/Dynamoid/Associations/ManyAssociation.html +1640 -0
  23. data/doc/Dynamoid/Associations/SingleAssociation.html +598 -0
  24. data/doc/Dynamoid/Components.html +204 -0
  25. data/doc/Dynamoid/Config.html +395 -0
  26. data/doc/Dynamoid/Config/Options.html +609 -0
  27. data/doc/Dynamoid/Criteria.html +131 -0
  28. data/doc/Dynamoid/Criteria/Chain.html +1063 -0
  29. data/doc/Dynamoid/Criteria/ClassMethods.html +98 -0
  30. data/doc/Dynamoid/Document.html +666 -0
  31. data/doc/Dynamoid/Document/ClassMethods.html +937 -0
  32. data/doc/Dynamoid/Errors.html +118 -0
  33. data/doc/Dynamoid/Errors/DocumentNotValid.html +210 -0
  34. data/doc/Dynamoid/Errors/Error.html +130 -0
  35. data/doc/Dynamoid/Errors/InvalidField.html +133 -0
  36. data/doc/Dynamoid/Errors/MissingRangeKey.html +133 -0
  37. data/doc/Dynamoid/Fields.html +669 -0
  38. data/doc/Dynamoid/Fields/ClassMethods.html +309 -0
  39. data/doc/Dynamoid/Finders.html +128 -0
  40. data/doc/Dynamoid/Finders/ClassMethods.html +516 -0
  41. data/doc/Dynamoid/Indexes.html +308 -0
  42. data/doc/Dynamoid/Indexes/ClassMethods.html +353 -0
  43. data/doc/Dynamoid/Indexes/Index.html +1104 -0
  44. data/doc/Dynamoid/Persistence.html +651 -0
  45. data/doc/Dynamoid/Persistence/ClassMethods.html +670 -0
  46. data/doc/Dynamoid/Validations.html +399 -0
  47. data/doc/_index.html +461 -0
  48. data/doc/class_list.html +47 -0
  49. data/doc/css/common.css +1 -0
  50. data/doc/css/full_list.css +55 -0
  51. data/doc/css/style.css +322 -0
  52. data/doc/file.LICENSE.html +66 -0
  53. data/doc/file.README.html +312 -0
  54. data/doc/file_list.html +52 -0
  55. data/doc/frames.html +13 -0
  56. data/doc/index.html +312 -0
  57. data/doc/js/app.js +205 -0
  58. data/doc/js/full_list.js +173 -0
  59. data/doc/js/jquery.js +16 -0
  60. data/doc/method_list.html +1238 -0
  61. data/doc/top-level-namespace.html +105 -0
  62. data/lib/dynamoid.rb +47 -0
  63. data/lib/dynamoid/adapter.rb +177 -0
  64. data/lib/dynamoid/adapter/aws_sdk.rb +223 -0
  65. data/lib/dynamoid/associations.rb +106 -0
  66. data/lib/dynamoid/associations/association.rb +105 -0
  67. data/lib/dynamoid/associations/belongs_to.rb +44 -0
  68. data/lib/dynamoid/associations/has_and_belongs_to_many.rb +40 -0
  69. data/lib/dynamoid/associations/has_many.rb +39 -0
  70. data/lib/dynamoid/associations/has_one.rb +39 -0
  71. data/lib/dynamoid/associations/many_association.rb +191 -0
  72. data/lib/dynamoid/associations/single_association.rb +69 -0
  73. data/lib/dynamoid/components.rb +36 -0
  74. data/lib/dynamoid/config.rb +57 -0
  75. data/lib/dynamoid/config/options.rb +78 -0
  76. data/lib/dynamoid/criteria.rb +29 -0
  77. data/lib/dynamoid/criteria/chain.rb +243 -0
  78. data/lib/dynamoid/dirty.rb +41 -0
  79. data/lib/dynamoid/document.rb +184 -0
  80. data/lib/dynamoid/errors.rb +28 -0
  81. data/lib/dynamoid/fields.rb +130 -0
  82. data/lib/dynamoid/finders.rb +131 -0
  83. data/lib/dynamoid/identity_map.rb +96 -0
  84. data/lib/dynamoid/indexes.rb +69 -0
  85. data/lib/dynamoid/indexes/index.rb +103 -0
  86. data/lib/dynamoid/middleware/identity_map.rb +16 -0
  87. data/lib/dynamoid/persistence.rb +247 -0
  88. data/lib/dynamoid/validations.rb +36 -0
  89. data/spec/app/models/address.rb +10 -0
  90. data/spec/app/models/camel_case.rb +24 -0
  91. data/spec/app/models/magazine.rb +11 -0
  92. data/spec/app/models/message.rb +9 -0
  93. data/spec/app/models/sponsor.rb +8 -0
  94. data/spec/app/models/subscription.rb +12 -0
  95. data/spec/app/models/tweet.rb +12 -0
  96. data/spec/app/models/user.rb +26 -0
  97. data/spec/dynamoid/adapter/aws_sdk_spec.rb +186 -0
  98. data/spec/dynamoid/adapter_spec.rb +117 -0
  99. data/spec/dynamoid/associations/association_spec.rb +194 -0
  100. data/spec/dynamoid/associations/belongs_to_spec.rb +71 -0
  101. data/spec/dynamoid/associations/has_and_belongs_to_many_spec.rb +47 -0
  102. data/spec/dynamoid/associations/has_many_spec.rb +42 -0
  103. data/spec/dynamoid/associations/has_one_spec.rb +45 -0
  104. data/spec/dynamoid/associations_spec.rb +16 -0
  105. data/spec/dynamoid/config_spec.rb +27 -0
  106. data/spec/dynamoid/criteria/chain_spec.rb +140 -0
  107. data/spec/dynamoid/criteria_spec.rb +72 -0
  108. data/spec/dynamoid/dirty_spec.rb +49 -0
  109. data/spec/dynamoid/document_spec.rb +118 -0
  110. data/spec/dynamoid/fields_spec.rb +127 -0
  111. data/spec/dynamoid/finders_spec.rb +135 -0
  112. data/spec/dynamoid/identity_map_spec.rb +45 -0
  113. data/spec/dynamoid/indexes/index_spec.rb +104 -0
  114. data/spec/dynamoid/indexes_spec.rb +25 -0
  115. data/spec/dynamoid/persistence_spec.rb +176 -0
  116. data/spec/dynamoid/validations_spec.rb +36 -0
  117. data/spec/dynamoid_spec.rb +9 -0
  118. data/spec/spec_helper.rb +50 -0
  119. metadata +376 -0
@@ -0,0 +1,131 @@
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: Dynamoid::Associations
8
+
9
+ &mdash; Documentation by YARD 0.7.5
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 (A)</a> &raquo;
37
+ <span class='title'><span class='object_link'><a href="../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span>
38
+ &raquo;
39
+ <span class="title">Associations</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: Dynamoid::Associations
60
+
61
+
62
+
63
+ </h1>
64
+
65
+ <dl class="box">
66
+
67
+
68
+
69
+ <dt class="r1">Extended by:</dt>
70
+ <dd class="r1">ActiveSupport::Concern</dd>
71
+
72
+
73
+
74
+
75
+
76
+
77
+ <dt class="r2">Included in:</dt>
78
+ <dd class="r2"><span class='object_link'><a href="Components.html" title="Dynamoid::Components (module)">Components</a></span></dd>
79
+
80
+
81
+
82
+ <dt class="r1 last">Defined in:</dt>
83
+ <dd class="r1 last">lib/dynamoid/associations.rb<span class="defines">,<br />
84
+ lib/dynamoid/associations/has_one.rb,<br /> lib/dynamoid/associations/has_many.rb,<br /> lib/dynamoid/associations/belongs_to.rb,<br /> lib/dynamoid/associations/association.rb,<br /> lib/dynamoid/associations/many_association.rb,<br /> lib/dynamoid/associations/single_association.rb,<br /> lib/dynamoid/associations/has_and_belongs_to_many.rb</span>
85
+ </dd>
86
+
87
+ </dl>
88
+ <div class="clear"></div>
89
+
90
+ <h2>Overview</h2><div class="docstring">
91
+ <div class="discussion">
92
+ <p>The has and belongs to many association.</p>
93
+
94
+
95
+ </div>
96
+ </div>
97
+ <div class="tags">
98
+
99
+
100
+ </div><h2>Defined Under Namespace</h2>
101
+ <p class="children">
102
+
103
+
104
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="Associations/Association.html" title="Dynamoid::Associations::Association (module)">Association</a></span>, <span class='object_link'><a href="Associations/ClassMethods.html" title="Dynamoid::Associations::ClassMethods (module)">ClassMethods</a></span>, <span class='object_link'><a href="Associations/ManyAssociation.html" title="Dynamoid::Associations::ManyAssociation (module)">ManyAssociation</a></span>, <span class='object_link'><a href="Associations/SingleAssociation.html" title="Dynamoid::Associations::SingleAssociation (module)">SingleAssociation</a></span>
105
+
106
+
107
+
108
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="Associations/BelongsTo.html" title="Dynamoid::Associations::BelongsTo (class)">BelongsTo</a></span>, <span class='object_link'><a href="Associations/HasAndBelongsToMany.html" title="Dynamoid::Associations::HasAndBelongsToMany (class)">HasAndBelongsToMany</a></span>, <span class='object_link'><a href="Associations/HasMany.html" title="Dynamoid::Associations::HasMany (class)">HasMany</a></span>, <span class='object_link'><a href="Associations/HasOne.html" title="Dynamoid::Associations::HasOne (class)">HasOne</a></span>
109
+
110
+
111
+ </p>
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+ </div>
123
+
124
+ <div id="footer">
125
+ Generated on Thu Apr 26 01:26:25 2012 by
126
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
127
+ 0.7.5 (ruby-1.9.3).
128
+ </div>
129
+
130
+ </body>
131
+ </html>
@@ -0,0 +1,794 @@
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: Dynamoid::Associations::Association
8
+
9
+ &mdash; Documentation by YARD 0.7.5
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 (A)</a> &raquo;
37
+ <span class='title'><span class='object_link'><a href="../../Dynamoid.html" title="Dynamoid (module)">Dynamoid</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Associations.html" title="Dynamoid::Associations (module)">Associations</a></span></span>
38
+ &raquo;
39
+ <span class="title">Association</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: Dynamoid::Associations::Association
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="HasOne.html" title="Dynamoid::Associations::HasOne (class)">HasOne</a></span>, <span class='object_link'><a href="ManyAssociation.html" title="Dynamoid::Associations::ManyAssociation (module)">ManyAssociation</a></span>, <span class='object_link'><a href="SingleAssociation.html" title="Dynamoid::Associations::SingleAssociation (module)">SingleAssociation</a></span></dd>
75
+
76
+
77
+
78
+ <dt class="r2 last">Defined in:</dt>
79
+ <dd class="r2 last">lib/dynamoid/associations/association.rb</dd>
80
+
81
+ </dl>
82
+ <div class="clear"></div>
83
+
84
+
85
+
86
+
87
+
88
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
89
+ <ul class="summary">
90
+
91
+ <li class="public ">
92
+ <span class="summary_signature">
93
+
94
+ <a href="#loaded-instance_method" title="#loaded (instance method)">- (Object) <strong>loaded</strong> </a>
95
+
96
+
97
+
98
+ </span>
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute loaded.</p>
111
+ </div></span>
112
+
113
+ </li>
114
+
115
+
116
+ <li class="public ">
117
+ <span class="summary_signature">
118
+
119
+ <a href="#name-instance_method" title="#name (instance method)">- (Object) <strong>name</strong> </a>
120
+
121
+
122
+
123
+ </span>
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute name.</p>
136
+ </div></span>
137
+
138
+ </li>
139
+
140
+
141
+ <li class="public ">
142
+ <span class="summary_signature">
143
+
144
+ <a href="#options-instance_method" title="#options (instance method)">- (Object) <strong>options</strong> </a>
145
+
146
+
147
+
148
+ </span>
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute options.</p>
161
+ </div></span>
162
+
163
+ </li>
164
+
165
+
166
+ <li class="public ">
167
+ <span class="summary_signature">
168
+
169
+ <a href="#source-instance_method" title="#source (instance method)">- (Object) <strong>source</strong> </a>
170
+
171
+
172
+
173
+ </span>
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+
185
+ <span class="summary_desc"><div class='inline'><p>Returns the value of attribute source.</p>
186
+ </div></span>
187
+
188
+ </li>
189
+
190
+
191
+ </ul>
192
+
193
+
194
+
195
+
196
+
197
+ <h2>
198
+ Instance Method Summary
199
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
200
+ </h2>
201
+
202
+ <ul class="summary">
203
+
204
+ <li class="public ">
205
+ <span class="summary_signature">
206
+
207
+ <a href="#find_target-instance_method" title="#find_target (instance method)">- (Object) <strong>find_target</strong> </a>
208
+
209
+
210
+
211
+ </span>
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+ <span class="summary_desc"><div class='inline'></div></span>
221
+
222
+ </li>
223
+
224
+
225
+ <li class="public ">
226
+ <span class="summary_signature">
227
+
228
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Dynamoid::Association) <strong>initialize</strong>(source, name, options) </a>
229
+
230
+
231
+
232
+ </span>
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+ <span class="summary_desc"><div class='inline'><p>Create a new association.</p>
242
+ </div></span>
243
+
244
+ </li>
245
+
246
+
247
+ <li class="public ">
248
+ <span class="summary_signature">
249
+
250
+ <a href="#loaded%3F-instance_method" title="#loaded? (instance method)">- (Boolean) <strong>loaded?</strong> </a>
251
+
252
+
253
+
254
+ </span>
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+ <span class="summary_desc"><div class='inline'></div></span>
264
+
265
+ </li>
266
+
267
+
268
+ <li class="public ">
269
+ <span class="summary_signature">
270
+
271
+ <a href="#reset-instance_method" title="#reset (instance method)">- (Object) <strong>reset</strong> </a>
272
+
273
+
274
+
275
+ </span>
276
+
277
+
278
+
279
+
280
+
281
+
282
+
283
+
284
+ <span class="summary_desc"><div class='inline'></div></span>
285
+
286
+ </li>
287
+
288
+
289
+ <li class="public ">
290
+ <span class="summary_signature">
291
+
292
+ <a href="#target-instance_method" title="#target (instance method)">- (Object) <strong>target</strong> </a>
293
+
294
+
295
+
296
+ </span>
297
+
298
+
299
+
300
+
301
+
302
+
303
+
304
+
305
+ <span class="summary_desc"><div class='inline'></div></span>
306
+
307
+ </li>
308
+
309
+
310
+ </ul>
311
+
312
+
313
+
314
+ <div id="instance_attr_details" class="attr_details">
315
+ <h2>Instance Attribute Details</h2>
316
+
317
+
318
+ <span id="loaded=-instance_method"></span>
319
+ <span id="loaded-instance_method"></span>
320
+ <div class="method_details first">
321
+ <p class="signature first" id="loaded-instance_method">
322
+
323
+ - (<tt>Object</tt>) <strong>loaded</strong>
324
+
325
+
326
+
327
+ </p><div class="docstring">
328
+ <div class="discussion">
329
+ <p>Returns the value of attribute loaded</p>
330
+
331
+
332
+ </div>
333
+ </div>
334
+ <div class="tags">
335
+
336
+
337
+ </div><table class="source_code">
338
+ <tr>
339
+ <td>
340
+ <pre class="lines">
341
+
342
+
343
+ 9
344
+ 10
345
+ 11</pre>
346
+ </td>
347
+ <td>
348
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/associations/association.rb', line 9</span>
349
+
350
+ <span class='kw'>def</span> <span class='id identifier rubyid_loaded'>loaded</span>
351
+ <span class='ivar'>@loaded</span>
352
+ <span class='kw'>end</span></pre>
353
+ </td>
354
+ </tr>
355
+ </table>
356
+ </div>
357
+
358
+
359
+ <span id="name=-instance_method"></span>
360
+ <span id="name-instance_method"></span>
361
+ <div class="method_details ">
362
+ <p class="signature " id="name-instance_method">
363
+
364
+ - (<tt>Object</tt>) <strong>name</strong>
365
+
366
+
367
+
368
+ </p><div class="docstring">
369
+ <div class="discussion">
370
+ <p>Returns the value of attribute name</p>
371
+
372
+
373
+ </div>
374
+ </div>
375
+ <div class="tags">
376
+
377
+
378
+ </div><table class="source_code">
379
+ <tr>
380
+ <td>
381
+ <pre class="lines">
382
+
383
+
384
+ 9
385
+ 10
386
+ 11</pre>
387
+ </td>
388
+ <td>
389
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/associations/association.rb', line 9</span>
390
+
391
+ <span class='kw'>def</span> <span class='id identifier rubyid_name'>name</span>
392
+ <span class='ivar'>@name</span>
393
+ <span class='kw'>end</span></pre>
394
+ </td>
395
+ </tr>
396
+ </table>
397
+ </div>
398
+
399
+
400
+ <span id="options=-instance_method"></span>
401
+ <span id="options-instance_method"></span>
402
+ <div class="method_details ">
403
+ <p class="signature " id="options-instance_method">
404
+
405
+ - (<tt>Object</tt>) <strong>options</strong>
406
+
407
+
408
+
409
+ </p><div class="docstring">
410
+ <div class="discussion">
411
+ <p>Returns the value of attribute options</p>
412
+
413
+
414
+ </div>
415
+ </div>
416
+ <div class="tags">
417
+
418
+
419
+ </div><table class="source_code">
420
+ <tr>
421
+ <td>
422
+ <pre class="lines">
423
+
424
+
425
+ 9
426
+ 10
427
+ 11</pre>
428
+ </td>
429
+ <td>
430
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/associations/association.rb', line 9</span>
431
+
432
+ <span class='kw'>def</span> <span class='id identifier rubyid_options'>options</span>
433
+ <span class='ivar'>@options</span>
434
+ <span class='kw'>end</span></pre>
435
+ </td>
436
+ </tr>
437
+ </table>
438
+ </div>
439
+
440
+
441
+ <span id="source=-instance_method"></span>
442
+ <span id="source-instance_method"></span>
443
+ <div class="method_details ">
444
+ <p class="signature " id="source-instance_method">
445
+
446
+ - (<tt>Object</tt>) <strong>source</strong>
447
+
448
+
449
+
450
+ </p><div class="docstring">
451
+ <div class="discussion">
452
+ <p>Returns the value of attribute source</p>
453
+
454
+
455
+ </div>
456
+ </div>
457
+ <div class="tags">
458
+
459
+
460
+ </div><table class="source_code">
461
+ <tr>
462
+ <td>
463
+ <pre class="lines">
464
+
465
+
466
+ 9
467
+ 10
468
+ 11</pre>
469
+ </td>
470
+ <td>
471
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/associations/association.rb', line 9</span>
472
+
473
+ <span class='kw'>def</span> <span class='id identifier rubyid_source'>source</span>
474
+ <span class='ivar'>@source</span>
475
+ <span class='kw'>end</span></pre>
476
+ </td>
477
+ </tr>
478
+ </table>
479
+ </div>
480
+
481
+ </div>
482
+
483
+
484
+ <div id="instance_method_details" class="method_details_list">
485
+ <h2>Instance Method Details</h2>
486
+
487
+
488
+ <div class="method_details first">
489
+ <p class="signature first" id="find_target-instance_method">
490
+
491
+ - (<tt>Object</tt>) <strong>find_target</strong>
492
+
493
+
494
+
495
+ </p><table class="source_code">
496
+ <tr>
497
+ <td>
498
+ <pre class="lines">
499
+
500
+
501
+ 34
502
+ 35</pre>
503
+ </td>
504
+ <td>
505
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/associations/association.rb', line 34</span>
506
+
507
+ <span class='kw'>def</span> <span class='id identifier rubyid_find_target'>find_target</span>
508
+ <span class='kw'>end</span></pre>
509
+ </td>
510
+ </tr>
511
+ </table>
512
+ </div>
513
+
514
+ <div class="method_details ">
515
+ <p class="signature " id="initialize-instance_method">
516
+
517
+ - (<tt>Dynamoid::Association</tt>) <strong>initialize</strong>(source, name, options)
518
+
519
+
520
+
521
+ </p><div class="docstring">
522
+ <div class="discussion">
523
+ <p>Create a new association.</p>
524
+
525
+
526
+ </div>
527
+ </div>
528
+ <div class="tags">
529
+ <h3>Parameters:</h3>
530
+ <ul class="param">
531
+
532
+ <li>
533
+
534
+ <span class='name'>source</span>
535
+
536
+
537
+ <span class='type'>(<tt>Class</tt>)</span>
538
+
539
+
540
+
541
+ &mdash;
542
+ <div class='inline'><p>the source record of the association; that is, the record that you already have</p>
543
+ </div>
544
+
545
+ </li>
546
+
547
+ <li>
548
+
549
+ <span class='name'>name</span>
550
+
551
+
552
+ <span class='type'>(<tt>Symbol</tt>)</span>
553
+
554
+
555
+
556
+ &mdash;
557
+ <div class='inline'><p>the name of the association</p>
558
+ </div>
559
+
560
+ </li>
561
+
562
+ <li>
563
+
564
+ <span class='name'>options</span>
565
+
566
+
567
+ <span class='type'>(<tt>Hash</tt>)</span>
568
+
569
+
570
+
571
+ &mdash;
572
+ <div class='inline'><p>optional parameters for the association</p>
573
+ </div>
574
+
575
+ </li>
576
+
577
+ </ul>
578
+
579
+
580
+
581
+
582
+
583
+
584
+
585
+
586
+ <h3>Options Hash (<tt>options</tt>):</h3>
587
+ <ul class="option">
588
+
589
+ <li>
590
+ <span class="name">:class</span>
591
+ <span class="type">(<tt>Class</tt>)</span>
592
+ <span class="default">
593
+
594
+ </span>
595
+ &mdash; <div class='inline'><p>the target class of the association; that is, the class to which the association objects belong</p>
596
+ </div>
597
+ </li>
598
+
599
+ <li>
600
+ <span class="name">:class_name</span>
601
+ <span class="type">(<tt>Symbol</tt>)</span>
602
+ <span class="default">
603
+
604
+ </span>
605
+ &mdash; <div class='inline'><p>the name of the target class of the association; only this or Class is necessary</p>
606
+ </div>
607
+ </li>
608
+
609
+ <li>
610
+ <span class="name">:inverse_of</span>
611
+ <span class="type">(<tt>Symbol</tt>)</span>
612
+ <span class="default">
613
+
614
+ </span>
615
+ &mdash; <div class='inline'><p>the name of the association on the target class</p>
616
+ </div>
617
+ </li>
618
+
619
+ </ul>
620
+
621
+
622
+ <h3>Since:</h3>
623
+ <ul class="since">
624
+
625
+ <li>
626
+
627
+
628
+
629
+
630
+
631
+ <div class='inline'><p>0.2.0</p>
632
+ </div>
633
+
634
+ </li>
635
+
636
+ </ul>
637
+
638
+ </div><table class="source_code">
639
+ <tr>
640
+ <td>
641
+ <pre class="lines">
642
+
643
+
644
+ 23
645
+ 24
646
+ 25
647
+ 26
648
+ 27
649
+ 28</pre>
650
+ </td>
651
+ <td>
652
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/associations/association.rb', line 23</span>
653
+
654
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_source'>source</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><span class='rparen'>)</span>
655
+ <span class='ivar'>@name</span> <span class='op'>=</span> <span class='id identifier rubyid_name'>name</span>
656
+ <span class='ivar'>@options</span> <span class='op'>=</span> <span class='id identifier rubyid_options'>options</span>
657
+ <span class='ivar'>@source</span> <span class='op'>=</span> <span class='id identifier rubyid_source'>source</span>
658
+ <span class='ivar'>@loaded</span> <span class='op'>=</span> <span class='kw'>false</span>
659
+ <span class='kw'>end</span></pre>
660
+ </td>
661
+ </tr>
662
+ </table>
663
+ </div>
664
+
665
+ <div class="method_details ">
666
+ <p class="signature " id="loaded?-instance_method">
667
+
668
+ - (<tt>Boolean</tt>) <strong>loaded?</strong>
669
+
670
+
671
+
672
+ </p><div class="docstring">
673
+ <div class="discussion">
674
+
675
+
676
+ </div>
677
+ </div>
678
+ <div class="tags">
679
+
680
+ <h3>Returns:</h3>
681
+ <ul class="return">
682
+
683
+ <li>
684
+
685
+
686
+ <span class='type'>(<tt>Boolean</tt>)</span>
687
+
688
+
689
+
690
+ </li>
691
+
692
+ </ul>
693
+
694
+ </div><table class="source_code">
695
+ <tr>
696
+ <td>
697
+ <pre class="lines">
698
+
699
+
700
+ 30
701
+ 31
702
+ 32</pre>
703
+ </td>
704
+ <td>
705
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/associations/association.rb', line 30</span>
706
+
707
+ <span class='kw'>def</span> <span class='id identifier rubyid_loaded?'>loaded?</span>
708
+ <span class='ivar'>@loaded</span>
709
+ <span class='kw'>end</span></pre>
710
+ </td>
711
+ </tr>
712
+ </table>
713
+ </div>
714
+
715
+ <div class="method_details ">
716
+ <p class="signature " id="reset-instance_method">
717
+
718
+ - (<tt>Object</tt>) <strong>reset</strong>
719
+
720
+
721
+
722
+ </p><table class="source_code">
723
+ <tr>
724
+ <td>
725
+ <pre class="lines">
726
+
727
+
728
+ 46
729
+ 47
730
+ 48
731
+ 49</pre>
732
+ </td>
733
+ <td>
734
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/associations/association.rb', line 46</span>
735
+
736
+ <span class='kw'>def</span> <span class='id identifier rubyid_reset'>reset</span>
737
+ <span class='ivar'>@target</span> <span class='op'>=</span> <span class='kw'>nil</span>
738
+ <span class='ivar'>@loaded</span> <span class='op'>=</span> <span class='kw'>false</span>
739
+ <span class='kw'>end</span></pre>
740
+ </td>
741
+ </tr>
742
+ </table>
743
+ </div>
744
+
745
+ <div class="method_details ">
746
+ <p class="signature " id="target-instance_method">
747
+
748
+ - (<tt>Object</tt>) <strong>target</strong>
749
+
750
+
751
+
752
+ </p><table class="source_code">
753
+ <tr>
754
+ <td>
755
+ <pre class="lines">
756
+
757
+
758
+ 37
759
+ 38
760
+ 39
761
+ 40
762
+ 41
763
+ 42
764
+ 43
765
+ 44</pre>
766
+ </td>
767
+ <td>
768
+ <pre class="code"><span class="info file"># File 'lib/dynamoid/associations/association.rb', line 37</span>
769
+
770
+ <span class='kw'>def</span> <span class='id identifier rubyid_target'>target</span>
771
+ <span class='kw'>unless</span> <span class='id identifier rubyid_loaded?'>loaded?</span>
772
+ <span class='ivar'>@target</span> <span class='op'>=</span> <span class='id identifier rubyid_find_target'>find_target</span>
773
+ <span class='ivar'>@loaded</span> <span class='op'>=</span> <span class='kw'>true</span>
774
+ <span class='kw'>end</span>
775
+
776
+ <span class='ivar'>@target</span>
777
+ <span class='kw'>end</span></pre>
778
+ </td>
779
+ </tr>
780
+ </table>
781
+ </div>
782
+
783
+ </div>
784
+
785
+ </div>
786
+
787
+ <div id="footer">
788
+ Generated on Thu Apr 26 01:26:26 2012 by
789
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
790
+ 0.7.5 (ruby-1.9.3).
791
+ </div>
792
+
793
+ </body>
794
+ </html>