sqlconstructor 0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +15 -0
  2. data/LICENSE.md +16 -0
  3. data/README.md +161 -0
  4. data/Rakefile +11 -0
  5. data/doc/Object.html +267 -0
  6. data/doc/Rakefile.html +150 -0
  7. data/doc/SQLAliasedList.html +717 -0
  8. data/doc/SQLColumn.html +326 -0
  9. data/doc/SQLCondList.html +318 -0
  10. data/doc/SQLConditional.html +1082 -0
  11. data/doc/SQLConditional/BasicCond.html +325 -0
  12. data/doc/SQLConstructor.html +763 -0
  13. data/doc/SQLConstructor/BasicDelete.html +383 -0
  14. data/doc/SQLConstructor/BasicDelete_mysql.html +368 -0
  15. data/doc/SQLConstructor/BasicInsert.html +339 -0
  16. data/doc/SQLConstructor/BasicInsert_mysql.html +325 -0
  17. data/doc/SQLConstructor/BasicJoin.html +408 -0
  18. data/doc/SQLConstructor/BasicJoin_mysql.html +439 -0
  19. data/doc/SQLConstructor/BasicSelect.html +554 -0
  20. data/doc/SQLConstructor/BasicSelect_example.html +288 -0
  21. data/doc/SQLConstructor/BasicSelect_mysql.html +466 -0
  22. data/doc/SQLConstructor/BasicUnion.html +396 -0
  23. data/doc/SQLConstructor/BasicUpdate.html +409 -0
  24. data/doc/SQLConstructor/BasicUpdate_mysql.html +310 -0
  25. data/doc/SQLConstructor/GenericQuery.html +797 -0
  26. data/doc/SQLConstructor/QAttr.html +398 -0
  27. data/doc/SQLConstructorTest.html +603 -0
  28. data/doc/SQLExporter.html +382 -0
  29. data/doc/SQLExporter/Exporter_generic.html +413 -0
  30. data/doc/SQLExporter/Exporter_mysql.html +395 -0
  31. data/doc/SQLObject.html +525 -0
  32. data/doc/SQLValList.html +322 -0
  33. data/doc/SQLValue.html +375 -0
  34. data/doc/created.rid +12 -0
  35. data/doc/images/brick.png +0 -0
  36. data/doc/images/brick_link.png +0 -0
  37. data/doc/images/bug.png +0 -0
  38. data/doc/images/bullet_black.png +0 -0
  39. data/doc/images/bullet_toggle_minus.png +0 -0
  40. data/doc/images/bullet_toggle_plus.png +0 -0
  41. data/doc/images/date.png +0 -0
  42. data/doc/images/find.png +0 -0
  43. data/doc/images/loadingAnimation.gif +0 -0
  44. data/doc/images/macFFBgHack.png +0 -0
  45. data/doc/images/package.png +0 -0
  46. data/doc/images/page_green.png +0 -0
  47. data/doc/images/page_white_text.png +0 -0
  48. data/doc/images/page_white_width.png +0 -0
  49. data/doc/images/plugin.png +0 -0
  50. data/doc/images/ruby.png +0 -0
  51. data/doc/images/tag_green.png +0 -0
  52. data/doc/images/wrench.png +0 -0
  53. data/doc/images/wrench_orange.png +0 -0
  54. data/doc/images/zoom.png +0 -0
  55. data/doc/index.html +356 -0
  56. data/doc/js/darkfish.js +118 -0
  57. data/doc/js/jquery.js +32 -0
  58. data/doc/js/quicksearch.js +114 -0
  59. data/doc/js/thickbox-compressed.js +10 -0
  60. data/doc/lib/dialects/example-constructor_rb.html +52 -0
  61. data/doc/lib/dialects/mysql-constructor_rb.html +52 -0
  62. data/doc/lib/dialects/mysql-exporter_rb.html +54 -0
  63. data/doc/lib/sqlconditional_rb.html +64 -0
  64. data/doc/lib/sqlconstructor_rb.html +52 -0
  65. data/doc/lib/sqlerrors_rb.html +54 -0
  66. data/doc/lib/sqlexporter_rb.html +55 -0
  67. data/doc/lib/sqlobject_rb.html +54 -0
  68. data/doc/rdoc.css +763 -0
  69. data/doc/test/queries_rb.html +56 -0
  70. data/doc/test_rb.html +52 -0
  71. data/lib/dialects/example-constructor.rb +45 -0
  72. data/lib/dialects/mysql-constructor.rb +247 -0
  73. data/lib/dialects/mysql-exporter.rb +108 -0
  74. data/lib/sqlconditional.rb +196 -0
  75. data/lib/sqlconstructor.rb +708 -0
  76. data/lib/sqlerrors.rb +15 -0
  77. data/lib/sqlexporter.rb +125 -0
  78. data/lib/sqlobject.rb +284 -0
  79. data/test/queries.rb +92 -0
  80. metadata +121 -0
@@ -0,0 +1,395 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
7
+
8
+ <title>Class: SQLExporter::Exporter_mysql</title>
9
+
10
+ <link rel="stylesheet" href="../rdoc.css" type="text/css" media="screen" />
11
+
12
+ <script src="../js/jquery.js" type="text/javascript" charset="utf-8"></script>
13
+ <script src="../js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
14
+ <script src="../js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
15
+ <script src="../js/darkfish.js" type="text/javascript" charset="utf-8"></script>
16
+
17
+ </head>
18
+ <body id="top" class="class">
19
+
20
+ <div id="metadata">
21
+ <div id="home-metadata">
22
+ <div id="home-section" class="section">
23
+ <h3 class="section-header">
24
+ <a href="../index.html">Home</a>
25
+ <a href="../index.html#classes">Classes</a>
26
+ <a href="../index.html#methods">Methods</a>
27
+ </h3>
28
+ </div>
29
+ </div>
30
+
31
+ <div id="file-metadata">
32
+ <div id="file-list-section" class="section">
33
+ <h3 class="section-header">In Files</h3>
34
+ <div class="section-body">
35
+ <ul>
36
+
37
+ <li><a href="../lib/dialects/mysql-exporter_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38
+ class="thickbox" title="lib/dialects/mysql-exporter.rb">lib/dialects/mysql-exporter.rb</a></li>
39
+
40
+ </ul>
41
+ </div>
42
+ </div>
43
+
44
+
45
+ </div>
46
+
47
+ <div id="class-metadata">
48
+
49
+ <!-- Parent Class -->
50
+ <div id="parent-class-section" class="section">
51
+ <h3 class="section-header">Parent</h3>
52
+
53
+ <p class="link"><a href="Exporter_generic.html">SQLExporter::Exporter_generic</a></p>
54
+
55
+ </div>
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+ <!-- Method Quickref -->
64
+ <div id="method-list-section" class="section">
65
+ <h3 class="section-header">Methods</h3>
66
+ <ul class="link-list">
67
+
68
+ <li><a href="#method-c-new">::new</a></li>
69
+
70
+ <li><a href="#method-i-attr_from">#attr_from</a></li>
71
+
72
+ <li><a href="#method-i-to_sWithAliasesIndexes">#to_sWithAliasesIndexes</a></li>
73
+
74
+ </ul>
75
+ </div>
76
+
77
+
78
+
79
+ </div>
80
+
81
+ <div id="project-metadata">
82
+
83
+
84
+ <div id="fileindex-section" class="section project-section">
85
+ <h3 class="section-header">Files</h3>
86
+ <ul>
87
+
88
+ <li class="file"><a href="../Rakefile.html">Rakefile</a></li>
89
+
90
+ </ul>
91
+ </div>
92
+
93
+
94
+ <div id="classindex-section" class="section project-section">
95
+ <h3 class="section-header">Class/Module Index
96
+ <span class="search-toggle"><img src="../images/find.png"
97
+ height="16" width="16" alt="[+]"
98
+ title="show/hide quicksearch" /></span></h3>
99
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
100
+ <fieldset>
101
+ <legend>Quicksearch</legend>
102
+ <input type="text" name="quicksearch" value=""
103
+ class="quicksearch-field" />
104
+ </fieldset>
105
+ </form>
106
+
107
+ <ul class="link-list">
108
+
109
+ <li><a href="../SQLConstructor.html">SQLConstructor</a></li>
110
+
111
+ <li><a href="../SQLConstructor/BasicDelete.html">SQLConstructor::BasicDelete</a></li>
112
+
113
+ <li><a href="../SQLConstructor/BasicDelete_mysql.html">SQLConstructor::BasicDelete_mysql</a></li>
114
+
115
+ <li><a href="../SQLConstructor/BasicInsert.html">SQLConstructor::BasicInsert</a></li>
116
+
117
+ <li><a href="../SQLConstructor/BasicInsert_mysql.html">SQLConstructor::BasicInsert_mysql</a></li>
118
+
119
+ <li><a href="../SQLConstructor/BasicJoin.html">SQLConstructor::BasicJoin</a></li>
120
+
121
+ <li><a href="../SQLConstructor/BasicJoin_mysql.html">SQLConstructor::BasicJoin_mysql</a></li>
122
+
123
+ <li><a href="../SQLConstructor/BasicSelect.html">SQLConstructor::BasicSelect</a></li>
124
+
125
+ <li><a href="../SQLConstructor/BasicSelect_example.html">SQLConstructor::BasicSelect_example</a></li>
126
+
127
+ <li><a href="../SQLConstructor/BasicSelect_mysql.html">SQLConstructor::BasicSelect_mysql</a></li>
128
+
129
+ <li><a href="../SQLConstructor/BasicUnion.html">SQLConstructor::BasicUnion</a></li>
130
+
131
+ <li><a href="../SQLConstructor/BasicUpdate.html">SQLConstructor::BasicUpdate</a></li>
132
+
133
+ <li><a href="../SQLConstructor/BasicUpdate_mysql.html">SQLConstructor::BasicUpdate_mysql</a></li>
134
+
135
+ <li><a href="../SQLConstructor/GenericQuery.html">SQLConstructor::GenericQuery</a></li>
136
+
137
+ <li><a href="../SQLConstructor/QAttr.html">SQLConstructor::QAttr</a></li>
138
+
139
+ <li><a href="../SQLExporter.html">SQLExporter</a></li>
140
+
141
+ <li><a href="../SQLExporter/Exporter_generic.html">SQLExporter::Exporter_generic</a></li>
142
+
143
+ <li><a href="../SQLExporter/Exporter_mysql.html">SQLExporter::Exporter_mysql</a></li>
144
+
145
+ <li><a href="../SQLConditional.html">SQLConditional</a></li>
146
+
147
+ <li><a href="../SQLConditional/BasicCond.html">SQLConditional::BasicCond</a></li>
148
+
149
+ <li><a href="../Object.html">Object</a></li>
150
+
151
+ <li><a href="../SQLAliasedList.html">SQLAliasedList</a></li>
152
+
153
+ <li><a href="../SQLColumn.html">SQLColumn</a></li>
154
+
155
+ <li><a href="../SQLCondList.html">SQLCondList</a></li>
156
+
157
+ <li><a href="../SQLConstructorTest.html">SQLConstructorTest</a></li>
158
+
159
+ <li><a href="../SQLObject.html">SQLObject</a></li>
160
+
161
+ <li><a href="../SQLValList.html">SQLValList</a></li>
162
+
163
+ <li><a href="../SQLValue.html">SQLValue</a></li>
164
+
165
+ </ul>
166
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
167
+ </div>
168
+
169
+
170
+ </div>
171
+ </div>
172
+
173
+ <div id="documentation">
174
+ <h1 class="class">SQLExporter::Exporter_mysql</h1>
175
+
176
+ <div id="description" class="description">
177
+
178
+ <p>MySQL dialect translator class.</p>
179
+
180
+ </div><!-- description -->
181
+
182
+
183
+
184
+
185
+ <div id="5Buntitled-5D" class="documentation-section">
186
+
187
+
188
+
189
+
190
+
191
+ <!-- Constants -->
192
+ <div id="constants-list" class="section">
193
+ <h3 class="section-header">Constants</h3>
194
+ <dl>
195
+
196
+ <dt><a name="DELETE_SYNTAX">DELETE_SYNTAX</a></dt>
197
+
198
+ <dd class="description"><p>The main rule for the MySQL DELETE query syntax</p></dd>
199
+
200
+
201
+ <dt><a name="INSERT_SYNTAX">INSERT_SYNTAX</a></dt>
202
+
203
+ <dd class="description"></dd>
204
+
205
+
206
+ <dt><a name="SELECT_SYNTAX">SELECT_SYNTAX</a></dt>
207
+
208
+ <dd class="description"><p>The main rule for the MySQL SELECT query syntax</p></dd>
209
+
210
+
211
+ <dt><a name="UPDATE_SYNTAX">UPDATE_SYNTAX</a></dt>
212
+
213
+ <dd class="description"></dd>
214
+
215
+
216
+ </dl>
217
+ </div>
218
+
219
+
220
+
221
+ <!-- Attributes -->
222
+ <div id="attribute-method-details" class="method-section section">
223
+ <h3 class="section-header">Attributes</h3>
224
+
225
+
226
+ <div id="dialect-attribute-method" class="method-detail">
227
+ <a name="dialect"></a>
228
+
229
+ <div class="method-heading attribute-method-heading">
230
+ <span class="method-name">dialect</span><span
231
+ class="attribute-access-type">[R]</span>
232
+ </div>
233
+
234
+ <div class="method-description">
235
+
236
+
237
+
238
+ </div>
239
+ </div>
240
+
241
+ </div><!-- attribute-method-details -->
242
+
243
+
244
+ <!-- Methods -->
245
+
246
+ <div id="public-class-method-details" class="method-section section">
247
+ <h3 class="section-header">Public Class Methods</h3>
248
+
249
+
250
+ <div id="new-method" class="method-detail ">
251
+ <a name="method-c-new"></a>
252
+
253
+
254
+ <div class="method-heading">
255
+ <span class="method-name">new</span><span
256
+ class="method-args">( tidy )</span>
257
+ <span class="method-click-advice">click to toggle source</span>
258
+ </div>
259
+
260
+
261
+ <div class="method-description">
262
+
263
+
264
+
265
+
266
+
267
+ <div class="method-source-code" id="new-source">
268
+ <pre>
269
+ <span class="ruby-comment"># File lib/dialects/mysql-exporter.rb, line 67</span>
270
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span> ( <span class="ruby-identifier">tidy</span> )
271
+ <span class="ruby-ivar">@tidy</span> = <span class="ruby-identifier">tidy</span>
272
+ <span class="ruby-ivar">@dialect</span> = <span class="ruby-string">'mysql'</span>
273
+ <span class="ruby-keyword">super</span> <span class="ruby-identifier">tidy</span> <span class="ruby-comment"># ha ha, &quot;super tidy&quot; :)</span>
274
+ <span class="ruby-keyword">end</span></pre>
275
+ </div><!-- new-source -->
276
+
277
+ </div>
278
+
279
+
280
+
281
+
282
+ </div><!-- new-method -->
283
+
284
+
285
+ </div><!-- public-class-method-details -->
286
+
287
+ <div id="public-instance-method-details" class="method-section section">
288
+ <h3 class="section-header">Public Instance Methods</h3>
289
+
290
+
291
+ <div id="attr_from-method" class="method-detail ">
292
+ <a name="method-i-attr_from"></a>
293
+
294
+
295
+ <div class="method-heading">
296
+ <span class="method-name">attr_from</span><span
297
+ class="method-args">( obj )</span>
298
+ <span class="method-click-advice">click to toggle source</span>
299
+ </div>
300
+
301
+
302
+ <div class="method-description">
303
+
304
+ <p>Forms a string for the FROM clause from the objects attributes @<a
305
+ href="Exporter_mysql.html#method-i-attr_from">attr_from</a> and
306
+ @attr_index_hints</p>
307
+
308
+
309
+
310
+ <div class="method-source-code" id="attr_from-source">
311
+ <pre>
312
+ <span class="ruby-comment"># File lib/dialects/mysql-exporter.rb, line 77</span>
313
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">attr_from</span> ( <span class="ruby-identifier">obj</span> )
314
+ <span class="ruby-identifier">result</span> = <span class="ruby-string">&quot;&quot;</span>
315
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">attr_from</span>
316
+ <span class="ruby-identifier">result</span> = <span class="ruby-string">&quot;FROM &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">to_sWithAliasesIndexes</span>( <span class="ruby-identifier">obj</span>, <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">attr_from</span>.<span class="ruby-identifier">val</span> )
317
+ <span class="ruby-keyword">end</span>
318
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">result</span>
319
+ <span class="ruby-keyword">end</span></pre>
320
+ </div><!-- attr_from-source -->
321
+
322
+ </div>
323
+
324
+
325
+
326
+
327
+ </div><!-- attr_from-method -->
328
+
329
+
330
+ </div><!-- public-instance-method-details -->
331
+
332
+ <div id="private-instance-method-details" class="method-section section">
333
+ <h3 class="section-header">Private Instance Methods</h3>
334
+
335
+
336
+ <div id="to_sWithAliasesIndexes-method" class="method-detail ">
337
+ <a name="method-i-to_sWithAliasesIndexes"></a>
338
+
339
+
340
+ <div class="method-heading">
341
+ <span class="method-name">to_sWithAliasesIndexes</span><span
342
+ class="method-args">( obj, list )</span>
343
+ <span class="method-click-advice">click to toggle source</span>
344
+ </div>
345
+
346
+
347
+ <div class="method-description">
348
+
349
+ <p>Returns a string of objects in list merged with indexes of obj</p>
350
+
351
+
352
+
353
+ <div class="method-source-code" id="to_sWithAliasesIndexes-source">
354
+ <pre>
355
+ <span class="ruby-comment"># File lib/dialects/mysql-exporter.rb, line 92</span>
356
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_sWithAliasesIndexes</span> ( <span class="ruby-identifier">obj</span>, <span class="ruby-identifier">list</span> )
357
+ <span class="ruby-identifier">list</span> = [ <span class="ruby-identifier">list</span> ] <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span> [ <span class="ruby-constant">Array</span>, <span class="ruby-constant">SQLValList</span>, <span class="ruby-constant">SQLAliasedList</span> ].<span class="ruby-identifier">include?</span> <span class="ruby-identifier">list</span>.<span class="ruby-identifier">class</span>
358
+ <span class="ruby-identifier">arr</span> = [ ]
359
+ <span class="ruby-identifier">list</span>.<span class="ruby-identifier">each_with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">item</span>,<span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
360
+ <span class="ruby-identifier">_alias</span> = <span class="ruby-identifier">item</span>.<span class="ruby-identifier">alias</span> <span class="ruby-operator">?</span> <span class="ruby-string">&quot; &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">item</span>.<span class="ruby-identifier">alias</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">:</span> <span class="ruby-string">&quot;&quot;</span>
361
+ <span class="ruby-identifier">str</span> = <span class="ruby-identifier">item</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">_alias</span>
362
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">attr_index_hints</span>
363
+ <span class="ruby-identifier">index_hash</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">attr_index_hints</span>[<span class="ruby-identifier">i</span>]
364
+ <span class="ruby-identifier">str</span> <span class="ruby-operator">+=</span> <span class="ruby-string">&quot; &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">index_hash</span>[<span class="ruby-value">:type</span>] <span class="ruby-operator">+</span> <span class="ruby-string">&quot; &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">index_hash</span>[<span class="ruby-value">:list</span>].<span class="ruby-identifier">to_s</span>
365
+ <span class="ruby-keyword">end</span>
366
+ <span class="ruby-identifier">arr</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">str</span>
367
+ <span class="ruby-keyword">end</span>
368
+ <span class="ruby-keyword">return</span> <span class="ruby-identifier">arr</span>.<span class="ruby-identifier">join</span> <span class="ruby-string">','</span>
369
+ <span class="ruby-keyword">end</span></pre>
370
+ </div><!-- to_sWithAliasesIndexes-source -->
371
+
372
+ </div>
373
+
374
+
375
+
376
+
377
+ </div><!-- to_sWithAliasesIndexes-method -->
378
+
379
+
380
+ </div><!-- private-instance-method-details -->
381
+
382
+ </div><!-- 5Buntitled-5D -->
383
+
384
+
385
+ </div><!-- documentation -->
386
+
387
+ <div id="validator-badges">
388
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
389
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
390
+ Rdoc Generator</a> 2</small>.</p>
391
+ </div>
392
+
393
+ </body>
394
+ </html>
395
+
@@ -0,0 +1,525 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
7
+
8
+ <title>Class: SQLObject</title>
9
+
10
+ <link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
11
+
12
+ <script src="./js/jquery.js" type="text/javascript" charset="utf-8"></script>
13
+ <script src="./js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
14
+ <script src="./js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
15
+ <script src="./js/darkfish.js" type="text/javascript" charset="utf-8"></script>
16
+
17
+ </head>
18
+ <body id="top" class="class">
19
+
20
+ <div id="metadata">
21
+ <div id="home-metadata">
22
+ <div id="home-section" class="section">
23
+ <h3 class="section-header">
24
+ <a href="./index.html">Home</a>
25
+ <a href="./index.html#classes">Classes</a>
26
+ <a href="./index.html#methods">Methods</a>
27
+ </h3>
28
+ </div>
29
+ </div>
30
+
31
+ <div id="file-metadata">
32
+ <div id="file-list-section" class="section">
33
+ <h3 class="section-header">In Files</h3>
34
+ <div class="section-body">
35
+ <ul>
36
+
37
+ <li><a href="./lib/sqlobject_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38
+ class="thickbox" title="lib/sqlobject.rb">lib/sqlobject.rb</a></li>
39
+
40
+ </ul>
41
+ </div>
42
+ </div>
43
+
44
+
45
+ </div>
46
+
47
+ <div id="class-metadata">
48
+
49
+ <!-- Parent Class -->
50
+ <div id="parent-class-section" class="section">
51
+ <h3 class="section-header">Parent</h3>
52
+
53
+ <p class="link"><a href="Object.html">Object</a></p>
54
+
55
+ </div>
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+ <!-- Method Quickref -->
64
+ <div id="method-list-section" class="section">
65
+ <h3 class="section-header">Methods</h3>
66
+ <ul class="link-list">
67
+
68
+ <li><a href="#method-c-get">::get</a></li>
69
+
70
+ <li><a href="#method-c-new">::new</a></li>
71
+
72
+ <li><a href="#method-i-_name">#_name</a></li>
73
+
74
+ <li><a href="#method-i-_string">#_string</a></li>
75
+
76
+ <li><a href="#method-i-_string-3D">#_string=</a></li>
77
+
78
+ <li><a href="#method-i-to_s">#to_s</a></li>
79
+
80
+ </ul>
81
+ </div>
82
+
83
+
84
+
85
+ </div>
86
+
87
+ <div id="project-metadata">
88
+
89
+
90
+ <div id="fileindex-section" class="section project-section">
91
+ <h3 class="section-header">Files</h3>
92
+ <ul>
93
+
94
+ <li class="file"><a href="./Rakefile.html">Rakefile</a></li>
95
+
96
+ </ul>
97
+ </div>
98
+
99
+
100
+ <div id="classindex-section" class="section project-section">
101
+ <h3 class="section-header">Class/Module Index
102
+ <span class="search-toggle"><img src="./images/find.png"
103
+ height="16" width="16" alt="[+]"
104
+ title="show/hide quicksearch" /></span></h3>
105
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
106
+ <fieldset>
107
+ <legend>Quicksearch</legend>
108
+ <input type="text" name="quicksearch" value=""
109
+ class="quicksearch-field" />
110
+ </fieldset>
111
+ </form>
112
+
113
+ <ul class="link-list">
114
+
115
+ <li><a href="./SQLConstructor.html">SQLConstructor</a></li>
116
+
117
+ <li><a href="./SQLConstructor/BasicDelete.html">SQLConstructor::BasicDelete</a></li>
118
+
119
+ <li><a href="./SQLConstructor/BasicDelete_mysql.html">SQLConstructor::BasicDelete_mysql</a></li>
120
+
121
+ <li><a href="./SQLConstructor/BasicInsert.html">SQLConstructor::BasicInsert</a></li>
122
+
123
+ <li><a href="./SQLConstructor/BasicInsert_mysql.html">SQLConstructor::BasicInsert_mysql</a></li>
124
+
125
+ <li><a href="./SQLConstructor/BasicJoin.html">SQLConstructor::BasicJoin</a></li>
126
+
127
+ <li><a href="./SQLConstructor/BasicJoin_mysql.html">SQLConstructor::BasicJoin_mysql</a></li>
128
+
129
+ <li><a href="./SQLConstructor/BasicSelect.html">SQLConstructor::BasicSelect</a></li>
130
+
131
+ <li><a href="./SQLConstructor/BasicSelect_example.html">SQLConstructor::BasicSelect_example</a></li>
132
+
133
+ <li><a href="./SQLConstructor/BasicSelect_mysql.html">SQLConstructor::BasicSelect_mysql</a></li>
134
+
135
+ <li><a href="./SQLConstructor/BasicUnion.html">SQLConstructor::BasicUnion</a></li>
136
+
137
+ <li><a href="./SQLConstructor/BasicUpdate.html">SQLConstructor::BasicUpdate</a></li>
138
+
139
+ <li><a href="./SQLConstructor/BasicUpdate_mysql.html">SQLConstructor::BasicUpdate_mysql</a></li>
140
+
141
+ <li><a href="./SQLConstructor/GenericQuery.html">SQLConstructor::GenericQuery</a></li>
142
+
143
+ <li><a href="./SQLConstructor/QAttr.html">SQLConstructor::QAttr</a></li>
144
+
145
+ <li><a href="./SQLExporter.html">SQLExporter</a></li>
146
+
147
+ <li><a href="./SQLExporter/Exporter_generic.html">SQLExporter::Exporter_generic</a></li>
148
+
149
+ <li><a href="./SQLExporter/Exporter_mysql.html">SQLExporter::Exporter_mysql</a></li>
150
+
151
+ <li><a href="./SQLConditional.html">SQLConditional</a></li>
152
+
153
+ <li><a href="./SQLConditional/BasicCond.html">SQLConditional::BasicCond</a></li>
154
+
155
+ <li><a href="./Object.html">Object</a></li>
156
+
157
+ <li><a href="./SQLAliasedList.html">SQLAliasedList</a></li>
158
+
159
+ <li><a href="./SQLColumn.html">SQLColumn</a></li>
160
+
161
+ <li><a href="./SQLCondList.html">SQLCondList</a></li>
162
+
163
+ <li><a href="./SQLConstructorTest.html">SQLConstructorTest</a></li>
164
+
165
+ <li><a href="./SQLObject.html">SQLObject</a></li>
166
+
167
+ <li><a href="./SQLValList.html">SQLValList</a></li>
168
+
169
+ <li><a href="./SQLValue.html">SQLValue</a></li>
170
+
171
+ </ul>
172
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
173
+ </div>
174
+
175
+
176
+ </div>
177
+ </div>
178
+
179
+ <div id="documentation">
180
+ <h1 class="class">SQLObject</h1>
181
+
182
+ <div id="description" class="description">
183
+
184
+ <p>Main class for all objects. All other entities should inherit this class.</p>
185
+
186
+ </div><!-- description -->
187
+
188
+
189
+
190
+
191
+ <div id="5Buntitled-5D" class="documentation-section">
192
+
193
+
194
+
195
+
196
+
197
+
198
+
199
+ <!-- Attributes -->
200
+ <div id="attribute-method-details" class="method-section section">
201
+ <h3 class="section-header">Attributes</h3>
202
+
203
+
204
+ <div id="alias-attribute-method" class="method-detail">
205
+ <a name="alias"></a>
206
+
207
+ <a name="alias="></a>
208
+
209
+ <div class="method-heading attribute-method-heading">
210
+ <span class="method-name">alias</span><span
211
+ class="attribute-access-type">[RW]</span>
212
+ </div>
213
+
214
+ <div class="method-description">
215
+
216
+
217
+
218
+ </div>
219
+ </div>
220
+
221
+ <div id="inline-attribute-method" class="method-detail">
222
+ <a name="inline"></a>
223
+
224
+ <a name="inline="></a>
225
+
226
+ <div class="method-heading attribute-method-heading">
227
+ <span class="method-name">inline</span><span
228
+ class="attribute-access-type">[RW]</span>
229
+ </div>
230
+
231
+ <div class="method-description">
232
+
233
+
234
+
235
+ </div>
236
+ </div>
237
+
238
+ <div id="name-attribute-method" class="method-detail">
239
+ <a name="name"></a>
240
+
241
+ <a name="name="></a>
242
+
243
+ <div class="method-heading attribute-method-heading">
244
+ <span class="method-name">name</span><span
245
+ class="attribute-access-type">[RW]</span>
246
+ </div>
247
+
248
+ <div class="method-description">
249
+
250
+
251
+
252
+ </div>
253
+ </div>
254
+
255
+ <div id="separator-attribute-method" class="method-detail">
256
+ <a name="separator"></a>
257
+
258
+ <a name="separator="></a>
259
+
260
+ <div class="method-heading attribute-method-heading">
261
+ <span class="method-name">separator</span><span
262
+ class="attribute-access-type">[RW]</span>
263
+ </div>
264
+
265
+ <div class="method-description">
266
+
267
+
268
+
269
+ </div>
270
+ </div>
271
+
272
+ </div><!-- attribute-method-details -->
273
+
274
+
275
+ <!-- Methods -->
276
+
277
+ <div id="public-class-method-details" class="method-section section">
278
+ <h3 class="section-header">Public Class Methods</h3>
279
+
280
+
281
+ <div id="get-method" class="method-detail ">
282
+ <a name="method-c-get"></a>
283
+
284
+
285
+ <div class="method-heading">
286
+ <span class="method-name">get</span><span
287
+ class="method-args">( *list )</span>
288
+ <span class="method-click-advice">click to toggle source</span>
289
+ </div>
290
+
291
+
292
+ <div class="method-description">
293
+
294
+ <p>Convert values to the corresponding internal data types</p>
295
+
296
+
297
+
298
+ <div class="method-source-code" id="get-source">
299
+ <pre>
300
+ <span class="ruby-comment"># File lib/sqlobject.rb, line 52</span>
301
+ <span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">get</span> ( *<span class="ruby-identifier">list</span> )
302
+ <span class="ruby-identifier">list</span>.<span class="ruby-identifier">map!</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">expr</span><span class="ruby-operator">|</span>
303
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">expr</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">SQLObject</span>
304
+ <span class="ruby-comment"># inline queries go in parens:</span>
305
+ <span class="ruby-keyword">if</span> <span class="ruby-identifier">expr</span>.<span class="ruby-identifier">class</span> <span class="ruby-operator">==</span> <span class="ruby-constant">SQLConstructor</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">expr</span>.<span class="ruby-identifier">is_a?</span>( <span class="ruby-constant">SQLConstructor</span><span class="ruby-operator">::</span><span class="ruby-constant">GenericQuery</span> )
306
+ <span class="ruby-identifier">expr</span>.<span class="ruby-identifier">inline</span> = <span class="ruby-keyword">true</span>
307
+ <span class="ruby-keyword">end</span>
308
+ <span class="ruby-identifier">expr</span>
309
+ <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">expr</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Array</span> <span class="ruby-keyword">or</span> <span class="ruby-identifier">expr</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Range</span>
310
+ <span class="ruby-constant">SQLValList</span>.<span class="ruby-identifier">new</span> *<span class="ruby-identifier">expr</span>.<span class="ruby-identifier">to_a</span>
311
+ <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">expr</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Hash</span>
312
+ <span class="ruby-constant">SQLAliasedList</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">expr</span>
313
+ <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">expr</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Symbol</span>
314
+ <span class="ruby-constant">SQLColumn</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">expr</span> )
315
+ <span class="ruby-keyword">else</span>
316
+ <span class="ruby-constant">SQLValue</span>.<span class="ruby-identifier">new</span>( <span class="ruby-identifier">expr</span> )
317
+ <span class="ruby-keyword">end</span>
318
+ <span class="ruby-keyword">end</span>
319
+
320
+ <span class="ruby-comment"># Return array or scalar, depending on the number of function arguments</span>
321
+ <span class="ruby-identifier">list</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">1</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">list</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">list</span>
322
+ <span class="ruby-keyword">end</span></pre>
323
+ </div><!-- get-source -->
324
+
325
+ </div>
326
+
327
+
328
+
329
+
330
+ </div><!-- get-method -->
331
+
332
+
333
+ <div id="new-method" class="method-detail ">
334
+ <a name="method-c-new"></a>
335
+
336
+
337
+ <div class="method-heading">
338
+ <span class="method-name">new</span><span
339
+ class="method-args">()</span>
340
+ <span class="method-click-advice">click to toggle source</span>
341
+ </div>
342
+
343
+
344
+ <div class="method-description">
345
+
346
+ <p>Do we really need a constructor here?</p>
347
+
348
+
349
+
350
+ <div class="method-source-code" id="new-source">
351
+ <pre>
352
+ <span class="ruby-comment"># File lib/sqlobject.rb, line 12</span>
353
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>
354
+ <span class="ruby-ivar">@string</span> = <span class="ruby-keyword">nil</span>
355
+ <span class="ruby-ivar">@alias</span> = <span class="ruby-keyword">nil</span>
356
+ <span class="ruby-ivar">@name</span> = <span class="ruby-keyword">nil</span>
357
+ <span class="ruby-ivar">@inline</span> = <span class="ruby-keyword">nil</span>
358
+ <span class="ruby-keyword">end</span></pre>
359
+ </div><!-- new-source -->
360
+
361
+ </div>
362
+
363
+
364
+
365
+
366
+ </div><!-- new-method -->
367
+
368
+
369
+ </div><!-- public-class-method-details -->
370
+
371
+ <div id="public-instance-method-details" class="method-section section">
372
+ <h3 class="section-header">Public Instance Methods</h3>
373
+
374
+
375
+ <div id="_name-method" class="method-detail ">
376
+ <a name="method-i-_name"></a>
377
+
378
+
379
+ <div class="method-heading">
380
+ <span class="method-name">_name</span><span
381
+ class="method-args">( name )</span>
382
+ <span class="method-click-advice">click to toggle source</span>
383
+ </div>
384
+
385
+
386
+ <div class="method-description">
387
+
388
+ <p>Set object’s name for further named processing</p>
389
+
390
+
391
+
392
+ <div class="method-source-code" id="_name-source">
393
+ <pre>
394
+ <span class="ruby-comment"># File lib/sqlobject.rb, line 22</span>
395
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">_name</span> ( <span class="ruby-identifier">name</span> )
396
+ <span class="ruby-ivar">@name</span> = <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>
397
+ <span class="ruby-keyword">return</span> <span class="ruby-keyword">self</span>
398
+ <span class="ruby-keyword">end</span></pre>
399
+ </div><!-- _name-source -->
400
+
401
+ </div>
402
+
403
+
404
+
405
+
406
+ </div><!-- _name-method -->
407
+
408
+
409
+ <div id="_string-method" class="method-detail ">
410
+ <a name="method-i-_string"></a>
411
+
412
+
413
+ <div class="method-heading">
414
+ <span class="method-name">_string</span><span
415
+ class="method-args">()</span>
416
+ <span class="method-click-advice">click to toggle source</span>
417
+ </div>
418
+
419
+
420
+ <div class="method-description">
421
+
422
+ <p>attr_reader for @string, actually an alias to <a
423
+ href="SQLObject.html#method-i-to_s">to_s</a>().</p>
424
+
425
+
426
+
427
+ <div class="method-source-code" id="_string-source">
428
+ <pre>
429
+ <span class="ruby-comment"># File lib/sqlobject.rb, line 38</span>
430
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">_string</span>
431
+ <span class="ruby-identifier">to_s</span>
432
+ <span class="ruby-keyword">end</span></pre>
433
+ </div><!-- _string-source -->
434
+
435
+ </div>
436
+
437
+
438
+
439
+
440
+ </div><!-- _string-method -->
441
+
442
+
443
+ <div id="_string-3D-method" class="method-detail ">
444
+ <a name="method-i-_string-3D"></a>
445
+
446
+
447
+ <div class="method-heading">
448
+ <span class="method-name">_string=</span><span
449
+ class="method-args">( val )</span>
450
+ <span class="method-click-advice">click to toggle source</span>
451
+ </div>
452
+
453
+
454
+ <div class="method-description">
455
+
456
+ <p>attr_writer for @string</p>
457
+
458
+
459
+
460
+ <div class="method-source-code" id="_string-3D-source">
461
+ <pre>
462
+ <span class="ruby-comment"># File lib/sqlobject.rb, line 45</span>
463
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">_string=</span> ( <span class="ruby-identifier">val</span> )
464
+ <span class="ruby-ivar">@string</span> = <span class="ruby-identifier">val</span>
465
+ <span class="ruby-keyword">end</span></pre>
466
+ </div><!-- _string-3D-source -->
467
+
468
+ </div>
469
+
470
+
471
+
472
+
473
+ </div><!-- _string-3D-method -->
474
+
475
+
476
+ <div id="to_s-method" class="method-detail ">
477
+ <a name="method-i-to_s"></a>
478
+
479
+
480
+ <div class="method-heading">
481
+ <span class="method-name">to_s</span><span
482
+ class="method-args">()</span>
483
+ <span class="method-click-advice">click to toggle source</span>
484
+ </div>
485
+
486
+
487
+ <div class="method-description">
488
+
489
+ <p>Store string representation in @string after the first call</p>
490
+
491
+
492
+
493
+ <div class="method-source-code" id="to_s-source">
494
+ <pre>
495
+ <span class="ruby-comment"># File lib/sqlobject.rb, line 30</span>
496
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_s</span>
497
+ <span class="ruby-keyword">return</span> <span class="ruby-ivar">@string</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@string</span>
498
+ <span class="ruby-ivar">@string</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">to_s</span>
499
+ <span class="ruby-keyword">end</span></pre>
500
+ </div><!-- to_s-source -->
501
+
502
+ </div>
503
+
504
+
505
+
506
+
507
+ </div><!-- to_s-method -->
508
+
509
+
510
+ </div><!-- public-instance-method-details -->
511
+
512
+ </div><!-- 5Buntitled-5D -->
513
+
514
+
515
+ </div><!-- documentation -->
516
+
517
+ <div id="validator-badges">
518
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
519
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
520
+ Rdoc Generator</a> 2</small>.</p>
521
+ </div>
522
+
523
+ </body>
524
+ </html>
525
+