inquery 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +16 -0
  3. data/.releaser_config +4 -0
  4. data/.rubocop.yml +42 -0
  5. data/.travis.yml +9 -0
  6. data/.yardopts +1 -0
  7. data/Gemfile +4 -0
  8. data/LICENSE +21 -0
  9. data/README.md +288 -0
  10. data/RUBY_VERSION +1 -0
  11. data/Rakefile +36 -0
  12. data/VERSION +1 -0
  13. data/doc/Inquery.html +119 -0
  14. data/doc/Inquery/Exceptions.html +115 -0
  15. data/doc/Inquery/Exceptions/Base.html +127 -0
  16. data/doc/Inquery/Exceptions/InvalidRelation.html +131 -0
  17. data/doc/Inquery/Exceptions/UnknownCallSignature.html +131 -0
  18. data/doc/Inquery/Mixins.html +117 -0
  19. data/doc/Inquery/Mixins/RelationValidation.html +334 -0
  20. data/doc/Inquery/Mixins/RelationValidation/ClassMethods.html +190 -0
  21. data/doc/Inquery/Mixins/SchemaValidation.html +124 -0
  22. data/doc/Inquery/Mixins/SchemaValidation/ClassMethods.html +192 -0
  23. data/doc/Inquery/Query.html +736 -0
  24. data/doc/Inquery/Query/Chainable.html +476 -0
  25. data/doc/_index.html +254 -0
  26. data/doc/class_list.html +58 -0
  27. data/doc/css/common.css +1 -0
  28. data/doc/css/full_list.css +57 -0
  29. data/doc/css/style.css +339 -0
  30. data/doc/file.README.html +365 -0
  31. data/doc/file_list.html +60 -0
  32. data/doc/frames.html +26 -0
  33. data/doc/index.html +365 -0
  34. data/doc/js/app.js +219 -0
  35. data/doc/js/full_list.js +181 -0
  36. data/doc/js/jquery.js +4 -0
  37. data/doc/method_list.html +147 -0
  38. data/doc/top-level-namespace.html +112 -0
  39. data/inquery.gemspec +58 -0
  40. data/lib/inquery.rb +10 -0
  41. data/lib/inquery/exceptions.rb +7 -0
  42. data/lib/inquery/mixins/relation_validation.rb +100 -0
  43. data/lib/inquery/mixins/schema_validation.rb +27 -0
  44. data/lib/inquery/query.rb +50 -0
  45. data/lib/inquery/query/chainable.rb +53 -0
  46. data/test/db/models.rb +20 -0
  47. data/test/db/schema.rb +20 -0
  48. data/test/inquery/query/chainable_test.rb +67 -0
  49. data/test/inquery/query_test.rb +47 -0
  50. data/test/queries/group/fetch_as_json.rb +13 -0
  51. data/test/queries/group/fetch_green.rb +11 -0
  52. data/test/queries/group/fetch_red.rb +11 -0
  53. data/test/queries/group/filter_with_color.rb +12 -0
  54. data/test/queries/user/fetch_all.rb +9 -0
  55. data/test/queries/user/fetch_in_group.rb +13 -0
  56. data/test/queries/user/fetch_in_group_rel.rb +17 -0
  57. data/test/test_helper.rb +26 -0
  58. metadata +265 -0
@@ -0,0 +1,476 @@
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: Inquery::Query::Chainable
8
+
9
+ &mdash; Documentation by YARD 0.8.7.6
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../../';
20
+ framesUrl = "../../frames.html#!Inquery/Query/Chainable.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../../_index.html">Index (C)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../../Inquery.html" title="Inquery (module)">Inquery</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Query.html" title="Inquery::Query (class)">Query</a></span></span>
36
+ &raquo;
37
+ <span class="title">Chainable</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: Inquery::Query::Chainable
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName"><span class='object_link'><a href="../Query.html" title="Inquery::Query (class)">Inquery::Query</a></span></span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next"><span class='object_link'><a href="../Query.html" title="Inquery::Query (class)">Inquery::Query</a></span></li>
82
+
83
+ <li class="next">Inquery::Query::Chainable</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dt class="r2">Includes:</dt>
96
+ <dd class="r2"><span class='object_link'><a href="../Mixins/RelationValidation.html" title="Inquery::Mixins::RelationValidation (module)">Mixins::RelationValidation</a></span></dd>
97
+
98
+
99
+
100
+
101
+
102
+ <dt class="r1 last">Defined in:</dt>
103
+ <dd class="r1 last">lib/inquery/query/chainable.rb</dd>
104
+
105
+ </dl>
106
+ <div class="clear"></div>
107
+
108
+
109
+ <h2>Constant Summary</h2>
110
+
111
+
112
+
113
+
114
+ <h2>Constant Summary</h2>
115
+
116
+ <h3 class="inherited">Constants included
117
+ from <span class='object_link'><a href="../Mixins/RelationValidation.html" title="Inquery::Mixins::RelationValidation (module)">Mixins::RelationValidation</a></span></h3>
118
+ <p class="inherited"><span class='object_link'><a href="../Mixins/RelationValidation.html#DEFAULT_OPTIONS-constant" title="Inquery::Mixins::RelationValidation::DEFAULT_OPTIONS (constant)">Mixins::RelationValidation::DEFAULT_OPTIONS</a></span>, <span class='object_link'><a href="../Mixins/RelationValidation.html#OPTIONS_SCHEMA-constant" title="Inquery::Mixins::RelationValidation::OPTIONS_SCHEMA (constant)">Mixins::RelationValidation::OPTIONS_SCHEMA</a></span></p>
119
+
120
+
121
+ <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
122
+ <ul class="summary">
123
+
124
+ <li class="public ">
125
+ <span class="summary_signature">
126
+
127
+ <a href="#relation-instance_method" title="#relation (instance method)">- (Object) <strong>relation</strong> </a>
128
+
129
+
130
+
131
+ </span>
132
+
133
+
134
+
135
+
136
+ <span class="note title readonly">readonly</span>
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+ <span class="summary_desc"><div class='inline'>
147
+ <p>Returns the value of attribute relation.</p>
148
+ </div></span>
149
+
150
+ </li>
151
+
152
+
153
+ </ul>
154
+
155
+
156
+
157
+
158
+
159
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="../Query.html" title="Inquery::Query (class)">Inquery::Query</a></span></h3>
160
+ <p class="inherited"><span class='object_link'><a href="../Query.html#params-instance_method" title="Inquery::Query#params (method)">#params</a></span></p>
161
+
162
+
163
+
164
+ <h2>
165
+ Class Method Summary
166
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
167
+ </h2>
168
+
169
+ <ul class="summary">
170
+
171
+ <li class="public ">
172
+ <span class="summary_signature">
173
+
174
+ <a href="#call-class_method" title="call (class method)">+ (Object) <strong>call</strong>(*args) </a>
175
+
176
+
177
+
178
+ </span>
179
+
180
+
181
+
182
+
183
+
184
+
185
+
186
+
187
+
188
+ <span class="summary_desc"><div class='inline'>
189
+ <p>Allows using this class as an AR scope.</p>
190
+ </div></span>
191
+
192
+ </li>
193
+
194
+
195
+ </ul>
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="#call-instance_method" title="#call (instance method)">- (Object) <strong>call</strong>(*args) </a>
208
+
209
+
210
+
211
+ </span>
212
+
213
+
214
+
215
+
216
+
217
+
218
+
219
+
220
+
221
+ <span class="summary_desc"><div class='inline'></div></span>
222
+
223
+ </li>
224
+
225
+
226
+ <li class="public ">
227
+ <span class="summary_signature">
228
+
229
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Chainable) <strong>initialize</strong>(*args) </a>
230
+
231
+
232
+
233
+ </span>
234
+
235
+
236
+ <span class="note title constructor">constructor</span>
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+ <span class="summary_desc"><div class='inline'>
246
+ <p>A new instance of Chainable.</p>
247
+ </div></span>
248
+
249
+ </li>
250
+
251
+
252
+ </ul>
253
+
254
+
255
+
256
+
257
+
258
+
259
+
260
+
261
+
262
+
263
+
264
+ <h3 class="inherited">Methods included from <span class='object_link'><a href="../Mixins/RelationValidation.html" title="Inquery::Mixins::RelationValidation (module)">Mixins::RelationValidation</a></span></h3>
265
+ <p class="inherited"><span class='object_link'><a href="../Mixins/RelationValidation.html#validate_relation%21-instance_method" title="Inquery::Mixins::RelationValidation#validate_relation! (method)">#validate_relation!</a></span></p>
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="../Query.html" title="Inquery::Query (class)">Inquery::Query</a></span></h3>
277
+ <p class="inherited"><span class='object_link'><a href="../Query.html#osparams-instance_method" title="Inquery::Query#osparams (method)">#osparams</a></span>, <span class='object_link'><a href="../Query.html#process-instance_method" title="Inquery::Query#process (method)">#process</a></span>, <span class='object_link'><a href="../Query.html#run-instance_method" title="Inquery::Query#run (method)">#run</a></span>, <span class='object_link'><a href="../Query.html#run-class_method" title="Inquery::Query.run (method)">run</a></span></p>
278
+
279
+
280
+
281
+
282
+
283
+
284
+
285
+ <div id="constructor_details" class="method_details_list">
286
+ <h2>Constructor Details</h2>
287
+
288
+ <div class="method_details first">
289
+ <h3 class="signature first" id="initialize-instance_method">
290
+
291
+ - (<tt><span class='object_link'><a href="" title="Inquery::Query::Chainable (class)">Chainable</a></span></tt>) <strong>initialize</strong>(*args)
292
+
293
+
294
+
295
+
296
+
297
+ </h3><div class="docstring">
298
+ <div class="discussion">
299
+
300
+ <p>Returns a new instance of Chainable</p>
301
+
302
+
303
+ </div>
304
+ </div>
305
+ <div class="tags">
306
+
307
+
308
+ </div><table class="source_code">
309
+ <tr>
310
+ <td>
311
+ <pre class="lines">
312
+
313
+
314
+ 16
315
+ 17
316
+ 18
317
+ 19
318
+ 20</pre>
319
+ </td>
320
+ <td>
321
+ <pre class="code"><span class="info file"># File 'lib/inquery/query/chainable.rb', line 16</span>
322
+
323
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
324
+ <span class='id identifier rubyid_relation'>relation</span><span class='comma'>,</span> <span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_init_args'>parse_init_args</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
325
+ <span class='ivar'>@relation</span> <span class='op'>=</span> <span class='id identifier rubyid_validate_relation!'>validate_relation!</span><span class='lparen'>(</span><span class='id identifier rubyid_relation'>relation</span><span class='rparen'>)</span>
326
+ <span class='kw'>super</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
327
+ <span class='kw'>end</span></pre>
328
+ </td>
329
+ </tr>
330
+ </table>
331
+ </div>
332
+
333
+ </div>
334
+
335
+ <div id="instance_attr_details" class="attr_details">
336
+ <h2>Instance Attribute Details</h2>
337
+
338
+
339
+ <span id=""></span>
340
+ <div class="method_details first">
341
+ <h3 class="signature first" id="relation-instance_method">
342
+
343
+ - (<tt>Object</tt>) <strong>relation</strong> <span class="extras">(readonly)</span>
344
+
345
+
346
+
347
+
348
+
349
+ </h3><div class="docstring">
350
+ <div class="discussion">
351
+
352
+ <p>Returns the value of attribute relation</p>
353
+
354
+
355
+ </div>
356
+ </div>
357
+ <div class="tags">
358
+
359
+
360
+ </div><table class="source_code">
361
+ <tr>
362
+ <td>
363
+ <pre class="lines">
364
+
365
+
366
+ 14
367
+ 15
368
+ 16</pre>
369
+ </td>
370
+ <td>
371
+ <pre class="code"><span class="info file"># File 'lib/inquery/query/chainable.rb', line 14</span>
372
+
373
+ <span class='kw'>def</span> <span class='id identifier rubyid_relation'>relation</span>
374
+ <span class='ivar'>@relation</span>
375
+ <span class='kw'>end</span></pre>
376
+ </td>
377
+ </tr>
378
+ </table>
379
+ </div>
380
+
381
+ </div>
382
+
383
+
384
+ <div id="class_method_details" class="method_details_list">
385
+ <h2>Class Method Details</h2>
386
+
387
+
388
+ <div class="method_details first">
389
+ <h3 class="signature first" id="call-class_method">
390
+
391
+ + (<tt>Object</tt>) <strong>call</strong>(*args)
392
+
393
+
394
+
395
+
396
+
397
+ </h3><div class="docstring">
398
+ <div class="discussion">
399
+
400
+ <p>Allows using this class as an AR scope.</p>
401
+
402
+
403
+ </div>
404
+ </div>
405
+ <div class="tags">
406
+
407
+
408
+ </div><table class="source_code">
409
+ <tr>
410
+ <td>
411
+ <pre class="lines">
412
+
413
+
414
+ 6
415
+ 7
416
+ 8</pre>
417
+ </td>
418
+ <td>
419
+ <pre class="code"><span class="info file"># File 'lib/inquery/query/chainable.rb', line 6</span>
420
+
421
+ <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
422
+ <span class='kw'>return</span> <span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span>
423
+ <span class='kw'>end</span></pre>
424
+ </td>
425
+ </tr>
426
+ </table>
427
+ </div>
428
+
429
+ </div>
430
+
431
+ <div id="instance_method_details" class="method_details_list">
432
+ <h2>Instance Method Details</h2>
433
+
434
+
435
+ <div class="method_details first">
436
+ <h3 class="signature first" id="call-instance_method">
437
+
438
+ - (<tt>Object</tt>) <strong>call</strong>(*args)
439
+
440
+
441
+
442
+
443
+
444
+ </h3><table class="source_code">
445
+ <tr>
446
+ <td>
447
+ <pre class="lines">
448
+
449
+
450
+ 10
451
+ 11
452
+ 12</pre>
453
+ </td>
454
+ <td>
455
+ <pre class="code"><span class="info file"># File 'lib/inquery/query/chainable.rb', line 10</span>
456
+
457
+ <span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
458
+ <span class='id identifier rubyid_fail'>fail</span> <span class='id identifier rubyid_args'>args</span><span class='period'>.</span><span class='id identifier rubyid_inspect'>inspect</span>
459
+ <span class='kw'>end</span></pre>
460
+ </td>
461
+ </tr>
462
+ </table>
463
+ </div>
464
+
465
+ </div>
466
+
467
+ </div>
468
+
469
+ <div id="footer">
470
+ Generated on Thu Jun 9 10:26:31 2016 by
471
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
472
+ 0.8.7.6 (ruby-2.2.3).
473
+ </div>
474
+
475
+ </body>
476
+ </html>