inquery 1.0.11 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/rubocop.yml +1 -1
  3. data/.github/workflows/ruby.yml +24 -8
  4. data/.gitignore +2 -2
  5. data/.rubocop.yml +4 -0
  6. data/Appraisals +24 -4
  7. data/CHANGELOG.md +38 -0
  8. data/Gemfile +17 -1
  9. data/Gemfile.lock +125 -0
  10. data/LICENSE +1 -1
  11. data/MIGRATION.md +260 -0
  12. data/README.md +14 -8
  13. data/RUBY_VERSION +1 -1
  14. data/Rakefile +4 -11
  15. data/VERSION +1 -1
  16. data/doc/Inquery/Exceptions/Base.html +4 -4
  17. data/doc/Inquery/Exceptions/InvalidRelation.html +4 -4
  18. data/doc/Inquery/Exceptions/UnknownCallSignature.html +4 -4
  19. data/doc/Inquery/Exceptions.html +4 -4
  20. data/doc/Inquery/MethodAccessibleHash.html +431 -0
  21. data/doc/Inquery/Mixins/RawSqlUtils.html +17 -4
  22. data/doc/Inquery/Mixins/RelationValidation/ClassMethods.html +8 -7
  23. data/doc/Inquery/Mixins/RelationValidation.html +9 -8
  24. data/doc/Inquery/Mixins/SchemaValidation/ClassMethods.html +4 -4
  25. data/doc/Inquery/Mixins/SchemaValidation.html +4 -4
  26. data/doc/Inquery/Mixins.html +4 -4
  27. data/doc/Inquery/Query/Chainable.html +207 -90
  28. data/doc/Inquery/Query.html +401 -73
  29. data/doc/Inquery.html +12 -9
  30. data/doc/_index.html +12 -5
  31. data/doc/class_list.html +6 -3
  32. data/doc/css/full_list.css +3 -3
  33. data/doc/css/style.css +6 -0
  34. data/doc/file.README.html +102 -16
  35. data/doc/file_list.html +5 -2
  36. data/doc/frames.html +10 -5
  37. data/doc/index.html +102 -16
  38. data/doc/js/app.js +294 -264
  39. data/doc/js/full_list.js +30 -4
  40. data/doc/method_list.html +48 -21
  41. data/doc/top-level-namespace.html +4 -4
  42. data/gemfiles/rails_5.2.gemfile +1 -0
  43. data/gemfiles/rails_6.0.gemfile +1 -0
  44. data/gemfiles/rails_6.1.gemfile +1 -0
  45. data/gemfiles/rails_7.0.gemfile +1 -0
  46. data/gemfiles/{rails_5.1.gemfile → rails_7.1.gemfile} +2 -1
  47. data/gemfiles/rails_7.2.gemfile +8 -0
  48. data/gemfiles/rails_8.0.gemfile +8 -0
  49. data/gemfiles/rails_8.1.gemfile +8 -0
  50. data/inquery.gemspec +11 -34
  51. data/lib/inquery/method_accessible_hash.rb +45 -0
  52. data/lib/inquery/mixins/raw_sql_utils.rb +32 -6
  53. data/lib/inquery/mixins/relation_validation.rb +1 -1
  54. data/lib/inquery/query/chainable.rb +69 -27
  55. data/lib/inquery/query.rb +67 -14
  56. data/lib/inquery.rb +2 -0
  57. data/test/inquery/error_handling_test.rb +117 -0
  58. data/test/inquery/method_accessible_hash_test.rb +85 -0
  59. data/test/inquery/mixins/raw_sql_utils_test.rb +67 -0
  60. data/test/inquery/query/chainable_test.rb +78 -0
  61. data/test/inquery/query_test.rb +86 -0
  62. data/test/test_helper.rb +11 -0
  63. metadata +30 -129
  64. data/.yardopts +0 -1
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Class: Inquery::Query
8
8
 
9
- &mdash; Documentation by YARD 0.9.27
9
+ &mdash; Documentation by YARD 0.9.37
10
10
 
11
11
  </title>
12
12
 
@@ -104,7 +104,31 @@
104
104
 
105
105
  </div>
106
106
 
107
- <div id="subclasses">
107
+ <h2>Overview</h2><div class="docstring">
108
+ <div class="discussion">
109
+
110
+ <p>Base query class that encapsulates database queries in reusable classes.</p>
111
+
112
+ <p>Subclasses must implement the ‘call’ method to define the query logic. Optionally, override ‘process’ to transform the query results.</p>
113
+
114
+ <p>Example:</p>
115
+
116
+ <pre class="code ruby"><code class="ruby"><span class='kw'>class</span> <span class='const'>FetchActiveUsers</span> <span class='op'>&lt;</span> <span class='const'><span class='object_link'><a href="../Inquery.html" title="Inquery (module)">Inquery</a></span></span><span class='op'>::</span><span class='const'>Query</span>
117
+ <span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span>
118
+ <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_where'>where</span><span class='lparen'>(</span><span class='label'>active:</span> <span class='kw'>true</span><span class='rparen'>)</span>
119
+ <span class='kw'>end</span>
120
+ <span class='kw'>end</span>
121
+
122
+ <span class='const'>FetchActiveUsers</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span> <span class='comment'># =&gt; Returns active users
123
+ </span></code></pre>
124
+
125
+
126
+ </div>
127
+ </div>
128
+ <div class="tags">
129
+
130
+
131
+ </div><div id="subclasses">
108
132
  <h2>Direct Known Subclasses</h2>
109
133
  <p class="children"><span class='object_link'><a href="Query/Chainable.html" title="Inquery::Query::Chainable (class)">Chainable</a></span></p>
110
134
  </div>
@@ -147,7 +171,8 @@
147
171
 
148
172
 
149
173
 
150
- <span class="summary_desc"><div class='inline'><p>Returns the value of attribute params.</p>
174
+ <span class="summary_desc"><div class='inline'>
175
+ <p>Returns the value of attribute params.</p>
151
176
  </div></span>
152
177
 
153
178
  </li>
@@ -183,7 +208,8 @@
183
208
 
184
209
 
185
210
 
186
- <span class="summary_desc"><div class='inline'><p>Instantiates the query class using the given arguments and runs <code>call</code> on it.</p>
211
+ <span class="summary_desc"><div class='inline'>
212
+ <p>Instantiates the query class with the given params and executes only the ‘call’ method, skipping post-processing.</p>
187
213
  </div></span>
188
214
 
189
215
  </li>
@@ -206,7 +232,8 @@
206
232
 
207
233
 
208
234
 
209
- <span class="summary_desc"><div class='inline'><p>Instantiates the query class using the given arguments and runs <code>call</code> and <code>process</code> on it.</p>
235
+ <span class="summary_desc"><div class='inline'>
236
+ <p>Instantiates the query class with the given params and executes both ‘call’ and ‘process’ methods.</p>
210
237
  </div></span>
211
238
 
212
239
  </li>
@@ -238,7 +265,8 @@
238
265
 
239
266
 
240
267
 
241
- <span class="summary_desc"><div class='inline'><p>Override this method to perform the actual query.</p>
268
+ <span class="summary_desc"><div class='inline'>
269
+ <p>Override this method in subclasses to define the query logic.</p>
242
270
  </div></span>
243
271
 
244
272
  </li>
@@ -247,7 +275,7 @@
247
275
  <li class="public ">
248
276
  <span class="summary_signature">
249
277
 
250
- <a href="#connection-instance_method" title="#connection (instance method)">#<strong>connection</strong> &#x21d2; Object </a>
278
+ <a href="#connection-instance_method" title="#connection (instance method)">#<strong>connection</strong> &#x21d2; ActiveRecord::ConnectionAdapters::AbstractAdapter </a>
251
279
 
252
280
 
253
281
 
@@ -261,7 +289,8 @@
261
289
 
262
290
 
263
291
 
264
- <span class="summary_desc"><div class='inline'><p>Provides a connection to the database.</p>
292
+ <span class="summary_desc"><div class='inline'>
293
+ <p>Returns the database connection to use for this query.</p>
265
294
  </div></span>
266
295
 
267
296
  </li>
@@ -286,7 +315,8 @@
286
315
 
287
316
 
288
317
 
289
- <span class="summary_desc"><div class='inline'><p>Instantiates the query class and validates the given params hash (if there was a validation schema specified).</p>
318
+ <span class="summary_desc"><div class='inline'>
319
+ <p>Initializes a new query instance with the given parameters.</p>
290
320
  </div></span>
291
321
 
292
322
  </li>
@@ -295,7 +325,7 @@
295
325
  <li class="public ">
296
326
  <span class="summary_signature">
297
327
 
298
- <a href="#osparams-instance_method" title="#osparams (instance method)">#<strong>osparams</strong> &#x21d2; Object </a>
328
+ <a href="#osparams-instance_method" title="#osparams (instance method)">#<strong>osparams</strong> &#x21d2; MethodAccessibleHash </a>
299
329
 
300
330
 
301
331
 
@@ -309,7 +339,8 @@
309
339
 
310
340
 
311
341
 
312
- <span class="summary_desc"><div class='inline'><p>Returns a copy of the query&#39;s params, wrapped in an OpenStruct object for easyer access.</p>
342
+ <span class="summary_desc"><div class='inline'>
343
+ <p>Returns the query params wrapped in a MethodAccessibleHash for convenient access using dot notation.</p>
313
344
  </div></span>
314
345
 
315
346
  </li>
@@ -332,7 +363,8 @@
332
363
 
333
364
 
334
365
 
335
- <span class="summary_desc"><div class='inline'><p>Override this method to perform an optional result postprocessing.</p>
366
+ <span class="summary_desc"><div class='inline'>
367
+ <p>Override this method in subclasses to transform the query results.</p>
336
368
  </div></span>
337
369
 
338
370
  </li>
@@ -355,7 +387,8 @@
355
387
 
356
388
 
357
389
 
358
- <span class="summary_desc"><div class='inline'><p>Runs both <code>call</code> and <code>process</code>.</p>
390
+ <span class="summary_desc"><div class='inline'>
391
+ <p>Executes the query by calling ‘call’ and then ‘process’.</p>
359
392
  </div></span>
360
393
 
361
394
  </li>
@@ -392,14 +425,56 @@
392
425
 
393
426
  </h3><div class="docstring">
394
427
  <div class="discussion">
395
- <p>Instantiates the query class and validates the given params hash (if there
396
- was a validation schema specified).</p>
428
+
429
+ <p>Initializes a new query instance with the given parameters.</p>
430
+
431
+ <p>If a schema is defined using ‘schema’ or ‘schema3’, the params will be validated against it before the query is executed.</p>
397
432
 
398
433
 
399
434
  </div>
400
435
  </div>
401
436
  <div class="tags">
437
+ <p class="tag_title">Parameters:</p>
438
+ <ul class="param">
402
439
 
440
+ <li>
441
+
442
+ <span class='name'>params</span>
443
+
444
+
445
+ <span class='type'>(<tt>Hash</tt>)</span>
446
+
447
+
448
+ <em class="default">(defaults to: <tt>{}</tt>)</em>
449
+
450
+
451
+ &mdash;
452
+ <div class='inline'>
453
+ <p>Parameters for the query</p>
454
+ </div>
455
+
456
+ </li>
457
+
458
+ </ul>
459
+
460
+ <p class="tag_title">Raises:</p>
461
+ <ul class="raise">
462
+
463
+ <li>
464
+
465
+
466
+ <span class='type'>(<tt>Schemacop::Exceptions::ValidationError</tt>)</span>
467
+
468
+
469
+
470
+ &mdash;
471
+ <div class='inline'>
472
+ <p>if params don’t match schema</p>
473
+ </div>
474
+
475
+ </li>
476
+
477
+ </ul>
403
478
 
404
479
  </div><table class="source_code">
405
480
  <tr>
@@ -407,16 +482,16 @@ was a validation schema specified).</p>
407
482
  <pre class="lines">
408
483
 
409
484
 
410
- 22
411
- 23
412
- 24
413
- 25
414
- 26
415
- 27
416
- 28</pre>
485
+ 52
486
+ 53
487
+ 54
488
+ 55
489
+ 56
490
+ 57
491
+ 58</pre>
417
492
  </td>
418
493
  <td>
419
- <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 22</span>
494
+ <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 52</span>
420
495
 
421
496
  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
422
497
  <span class='ivar'>@params</span> <span class='op'>=</span> <span class='id identifier rubyid_params'>params</span>
@@ -448,7 +523,8 @@ was a validation schema specified).</p>
448
523
 
449
524
  </h3><div class="docstring">
450
525
  <div class="discussion">
451
- <p>Returns the value of attribute params.</p>
526
+
527
+ <p>Returns the value of attribute params.</p>
452
528
 
453
529
 
454
530
  </div>
@@ -462,12 +538,12 @@ was a validation schema specified).</p>
462
538
  <pre class="lines">
463
539
 
464
540
 
465
- 6
466
- 7
467
- 8</pre>
541
+ 19
542
+ 20
543
+ 21</pre>
468
544
  </td>
469
545
  <td>
470
- <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 6</span>
546
+ <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 19</span>
471
547
 
472
548
  <span class='kw'>def</span> <span class='id identifier rubyid_params'>params</span>
473
549
  <span class='ivar'>@params</span>
@@ -495,14 +571,70 @@ was a validation schema specified).</p>
495
571
 
496
572
  </h3><div class="docstring">
497
573
  <div class="discussion">
498
- <p>Instantiates the query class using the given arguments
499
- and runs <code>call</code> on it.</p>
574
+
575
+ <p>Instantiates the query class with the given params and executes only the ‘call method, skipping post-processing.</p>
500
576
 
501
577
 
502
578
  </div>
503
579
  </div>
504
580
  <div class="tags">
581
+ <p class="tag_title">Parameters:</p>
582
+ <ul class="param">
583
+
584
+ <li>
585
+
586
+ <span class='name'>args</span>
587
+
588
+
589
+ <span class='type'>(<tt>Hash</tt>)</span>
590
+
591
+
592
+
593
+ &mdash;
594
+ <div class='inline'>
595
+ <p>Parameters to pass to the query</p>
596
+ </div>
597
+
598
+ </li>
599
+
600
+ </ul>
601
+
602
+ <p class="tag_title">Returns:</p>
603
+ <ul class="return">
604
+
605
+ <li>
606
+
607
+
608
+ <span class='type'>(<tt>Object</tt>)</span>
609
+
610
+
611
+
612
+ &mdash;
613
+ <div class='inline'>
614
+ <p>The raw query results</p>
615
+ </div>
616
+
617
+ </li>
505
618
 
619
+ </ul>
620
+ <p class="tag_title">Raises:</p>
621
+ <ul class="raise">
622
+
623
+ <li>
624
+
625
+
626
+ <span class='type'>(<tt>Schemacop::Exceptions::ValidationError</tt>)</span>
627
+
628
+
629
+
630
+ &mdash;
631
+ <div class='inline'>
632
+ <p>if params don’t match schema</p>
633
+ </div>
634
+
635
+ </li>
636
+
637
+ </ul>
506
638
 
507
639
  </div><table class="source_code">
508
640
  <tr>
@@ -510,12 +642,12 @@ and runs <code>call</code> on it.</p>
510
642
  <pre class="lines">
511
643
 
512
644
 
513
- 16
514
- 17
515
- 18</pre>
645
+ 41
646
+ 42
647
+ 43</pre>
516
648
  </td>
517
649
  <td>
518
- <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 16</span>
650
+ <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 41</span>
519
651
 
520
652
  <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>
521
653
  <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>
@@ -536,14 +668,72 @@ and runs <code>call</code> on it.</p>
536
668
 
537
669
  </h3><div class="docstring">
538
670
  <div class="discussion">
539
- <p>Instantiates the query class using the given arguments
540
- and runs <code>call</code> and <code>process</code> on it.</p>
671
+
672
+ <p>Instantiates the query class with the given params and executes both ‘call and process methods.</p>
673
+
674
+ <p>This is the primary way to execute queries. It runs the query logic defined in ‘call’ and then passes the results through ‘process’ for any post-processing.</p>
541
675
 
542
676
 
543
677
  </div>
544
678
  </div>
545
679
  <div class="tags">
680
+ <p class="tag_title">Parameters:</p>
681
+ <ul class="param">
682
+
683
+ <li>
684
+
685
+ <span class='name'>args</span>
686
+
687
+
688
+ <span class='type'>(<tt>Hash</tt>)</span>
689
+
690
+
691
+
692
+ &mdash;
693
+ <div class='inline'>
694
+ <p>Parameters to pass to the query</p>
695
+ </div>
696
+
697
+ </li>
698
+
699
+ </ul>
700
+
701
+ <p class="tag_title">Returns:</p>
702
+ <ul class="return">
703
+
704
+ <li>
705
+
706
+
707
+ <span class='type'>(<tt>Object</tt>)</span>
708
+
709
+
710
+
711
+ &mdash;
712
+ <div class='inline'>
713
+ <p>The processed query results</p>
714
+ </div>
715
+
716
+ </li>
717
+
718
+ </ul>
719
+ <p class="tag_title">Raises:</p>
720
+ <ul class="raise">
546
721
 
722
+ <li>
723
+
724
+
725
+ <span class='type'>(<tt>Schemacop::Exceptions::ValidationError</tt>)</span>
726
+
727
+
728
+
729
+ &mdash;
730
+ <div class='inline'>
731
+ <p>if params don’t match schema</p>
732
+ </div>
733
+
734
+ </li>
735
+
736
+ </ul>
547
737
 
548
738
  </div><table class="source_code">
549
739
  <tr>
@@ -551,12 +741,12 @@ and runs <code>call</code> and <code>process</code> on it.</p>
551
741
  <pre class="lines">
552
742
 
553
743
 
554
- 10
555
- 11
556
- 12</pre>
744
+ 31
745
+ 32
746
+ 33</pre>
557
747
  </td>
558
748
  <td>
559
- <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 10</span>
749
+ <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 31</span>
560
750
 
561
751
  <span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_run'>run</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_args'>args</span><span class='rparen'>)</span>
562
752
  <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_run'>run</span>
@@ -583,13 +773,50 @@ and runs <code>call</code> and <code>process</code> on it.</p>
583
773
 
584
774
  </h3><div class="docstring">
585
775
  <div class="discussion">
586
- <p>Override this method to perform the actual query.</p>
776
+
777
+ <p>Override this method in subclasses to define the query logic.</p>
587
778
 
588
779
 
589
780
  </div>
590
781
  </div>
591
782
  <div class="tags">
592
783
 
784
+ <p class="tag_title">Returns:</p>
785
+ <ul class="return">
786
+
787
+ <li>
788
+
789
+
790
+ <span class='type'>(<tt>Object</tt>)</span>
791
+
792
+
793
+
794
+ &mdash;
795
+ <div class='inline'>
796
+ <p>Query results (typically an ActiveRecord::Relation)</p>
797
+ </div>
798
+
799
+ </li>
800
+
801
+ </ul>
802
+ <p class="tag_title">Raises:</p>
803
+ <ul class="raise">
804
+
805
+ <li>
806
+
807
+
808
+ <span class='type'>(<tt>NotImplementedError</tt>)</span>
809
+
810
+
811
+
812
+ &mdash;
813
+ <div class='inline'>
814
+ <p>if not overridden in subclass</p>
815
+ </div>
816
+
817
+ </li>
818
+
819
+ </ul>
593
820
 
594
821
  </div><table class="source_code">
595
822
  <tr>
@@ -597,12 +824,12 @@ and runs <code>call</code> and <code>process</code> on it.</p>
597
824
  <pre class="lines">
598
825
 
599
826
 
600
- 36
601
- 37
602
- 38</pre>
827
+ 71
828
+ 72
829
+ 73</pre>
603
830
  </td>
604
831
  <td>
605
- <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 36</span>
832
+ <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 71</span>
606
833
 
607
834
  <span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span>
608
835
  <span class='id identifier rubyid_fail'>fail</span> <span class='const'>NotImplementedError</span>
@@ -615,7 +842,7 @@ and runs <code>call</code> and <code>process</code> on it.</p>
615
842
  <div class="method_details ">
616
843
  <h3 class="signature " id="connection-instance_method">
617
844
 
618
- #<strong>connection</strong> &#x21d2; <tt>Object</tt>
845
+ #<strong>connection</strong> &#x21d2; <tt>ActiveRecord::ConnectionAdapters::AbstractAdapter</tt>
619
846
 
620
847
 
621
848
 
@@ -623,14 +850,29 @@ and runs <code>call</code> and <code>process</code> on it.</p>
623
850
 
624
851
  </h3><div class="docstring">
625
852
  <div class="discussion">
626
- <p>Provides a connection to the database. May be overridden if a different
627
- connection is desired. Defaults to <code>ActiveRecord::Base.connection</code>.</p>
853
+
854
+ <p>Returns the database connection to use for this query.</p>
855
+
856
+ <p>Override this method if you need to use a different connection than the default ActiveRecord connection.</p>
628
857
 
629
858
 
630
859
  </div>
631
860
  </div>
632
861
  <div class="tags">
633
862
 
863
+ <p class="tag_title">Returns:</p>
864
+ <ul class="return">
865
+
866
+ <li>
867
+
868
+
869
+ <span class='type'>(<tt>ActiveRecord::ConnectionAdapters::AbstractAdapter</tt>)</span>
870
+
871
+
872
+
873
+ </li>
874
+
875
+ </ul>
634
876
 
635
877
  </div><table class="source_code">
636
878
  <tr>
@@ -638,12 +880,12 @@ connection is desired. Defaults to <code>ActiveRecord::Base.connection</code>.</
638
880
  <pre class="lines">
639
881
 
640
882
 
641
- 53
642
- 54
643
- 55</pre>
883
+ 106
884
+ 107
885
+ 108</pre>
644
886
  </td>
645
887
  <td>
646
- <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 53</span>
888
+ <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 106</span>
647
889
 
648
890
  <span class='kw'>def</span> <span class='id identifier rubyid_connection'>connection</span>
649
891
  <span class='const'>ActiveRecord</span><span class='op'>::</span><span class='const'>Base</span><span class='period'>.</span><span class='id identifier rubyid_connection'>connection</span>
@@ -656,7 +898,7 @@ connection is desired. Defaults to <code>ActiveRecord::Base.connection</code>.</
656
898
  <div class="method_details ">
657
899
  <h3 class="signature " id="osparams-instance_method">
658
900
 
659
- #<strong>osparams</strong> &#x21d2; <tt>Object</tt>
901
+ #<strong>osparams</strong> &#x21d2; <tt><span class='object_link'><a href="MethodAccessibleHash.html" title="Inquery::MethodAccessibleHash (class)">MethodAccessibleHash</a></span></tt>
660
902
 
661
903
 
662
904
 
@@ -664,14 +906,40 @@ connection is desired. Defaults to <code>ActiveRecord::Base.connection</code>.</
664
906
 
665
907
  </h3><div class="docstring">
666
908
  <div class="discussion">
667
- <p>Returns a copy of the query&#39;s params, wrapped in an OpenStruct object for
668
- easyer access.</p>
909
+
910
+ <p>Returns the query params wrapped in a MethodAccessibleHash for convenient access using dot notation.</p>
911
+
912
+ <p>Example:</p>
913
+
914
+ <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_schema3'>schema3</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_str!'>str!</span> <span class='symbol'>:name</span> <span class='rbrace'>}</span>
915
+ <span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span>
916
+ <span class='const'>User</span><span class='period'>.</span><span class='id identifier rubyid_where'>where</span><span class='lparen'>(</span><span class='label'>name:</span> <span class='id identifier rubyid_osparams'>osparams</span><span class='period'>.</span><span class='id identifier rubyid_name'>name</span><span class='rparen'>)</span> <span class='comment'># Access via dot notation
917
+ </span><span class='kw'>end</span>
918
+ </code></pre>
669
919
 
670
920
 
671
921
  </div>
672
922
  </div>
673
923
  <div class="tags">
674
924
 
925
+ <p class="tag_title">Returns:</p>
926
+ <ul class="return">
927
+
928
+ <li>
929
+
930
+
931
+ <span class='type'>(<tt><span class='object_link'><a href="MethodAccessibleHash.html" title="Inquery::MethodAccessibleHash (class)">MethodAccessibleHash</a></span></tt>)</span>
932
+
933
+
934
+
935
+ &mdash;
936
+ <div class='inline'>
937
+ <p>Params with method access</p>
938
+ </div>
939
+
940
+ </li>
941
+
942
+ </ul>
675
943
 
676
944
  </div><table class="source_code">
677
945
  <tr>
@@ -679,15 +947,15 @@ easyer access.</p>
679
947
  <pre class="lines">
680
948
 
681
949
 
682
- 47
683
- 48
684
- 49</pre>
950
+ 96
951
+ 97
952
+ 98</pre>
685
953
  </td>
686
954
  <td>
687
- <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 47</span>
955
+ <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 96</span>
688
956
 
689
957
  <span class='kw'>def</span> <span class='id identifier rubyid_osparams'>osparams</span>
690
- <span class='ivar'>@osparams</span> <span class='op'>||=</span> <span class='const'>OpenStruct</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
958
+ <span class='ivar'>@osparams</span> <span class='op'>||=</span> <span class='const'><span class='object_link'><a href="MethodAccessibleHash.html" title="Inquery::MethodAccessibleHash (class)">MethodAccessibleHash</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="MethodAccessibleHash.html#initialize-instance_method" title="Inquery::MethodAccessibleHash#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>
691
959
  <span class='kw'>end</span></pre>
692
960
  </td>
693
961
  </tr>
@@ -705,13 +973,54 @@ easyer access.</p>
705
973
 
706
974
  </h3><div class="docstring">
707
975
  <div class="discussion">
708
- <p>Override this method to perform an optional result postprocessing.</p>
976
+
977
+ <p>Override this method in subclasses to transform the query results.</p>
978
+
979
+ <p>By default, returns the results unchanged. Common uses include converting to JSON, counting records, or extracting specific fields.</p>
709
980
 
710
981
 
711
982
  </div>
712
983
  </div>
713
984
  <div class="tags">
985
+ <p class="tag_title">Parameters:</p>
986
+ <ul class="param">
987
+
988
+ <li>
989
+
990
+ <span class='name'>results</span>
991
+
992
+
993
+ <span class='type'>(<tt>Object</tt>)</span>
994
+
995
+
996
+
997
+ &mdash;
998
+ <div class='inline'>
999
+ <p>The results from the ‘call’ method</p>
1000
+ </div>
1001
+
1002
+ </li>
714
1003
 
1004
+ </ul>
1005
+
1006
+ <p class="tag_title">Returns:</p>
1007
+ <ul class="return">
1008
+
1009
+ <li>
1010
+
1011
+
1012
+ <span class='type'>(<tt>Object</tt>)</span>
1013
+
1014
+
1015
+
1016
+ &mdash;
1017
+ <div class='inline'>
1018
+ <p>The processed results</p>
1019
+ </div>
1020
+
1021
+ </li>
1022
+
1023
+ </ul>
715
1024
 
716
1025
  </div><table class="source_code">
717
1026
  <tr>
@@ -719,12 +1028,12 @@ easyer access.</p>
719
1028
  <pre class="lines">
720
1029
 
721
1030
 
722
- 41
723
- 42
724
- 43</pre>
1031
+ 82
1032
+ 83
1033
+ 84</pre>
725
1034
  </td>
726
1035
  <td>
727
- <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 41</span>
1036
+ <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 82</span>
728
1037
 
729
1038
  <span class='kw'>def</span> <span class='id identifier rubyid_process'>process</span><span class='lparen'>(</span><span class='id identifier rubyid_results'>results</span><span class='rparen'>)</span>
730
1039
  <span class='id identifier rubyid_results'>results</span>
@@ -745,13 +1054,32 @@ easyer access.</p>
745
1054
 
746
1055
  </h3><div class="docstring">
747
1056
  <div class="discussion">
748
- <p>Runs both <code>call</code> and <code>process</code>.</p>
1057
+
1058
+ <p>Executes the query by calling ‘call’ and then ‘process’.</p>
749
1059
 
750
1060
 
751
1061
  </div>
752
1062
  </div>
753
1063
  <div class="tags">
754
1064
 
1065
+ <p class="tag_title">Returns:</p>
1066
+ <ul class="return">
1067
+
1068
+ <li>
1069
+
1070
+
1071
+ <span class='type'>(<tt>Object</tt>)</span>
1072
+
1073
+
1074
+
1075
+ &mdash;
1076
+ <div class='inline'>
1077
+ <p>The processed query results</p>
1078
+ </div>
1079
+
1080
+ </li>
1081
+
1082
+ </ul>
755
1083
 
756
1084
  </div><table class="source_code">
757
1085
  <tr>
@@ -759,12 +1087,12 @@ easyer access.</p>
759
1087
  <pre class="lines">
760
1088
 
761
1089
 
762
- 31
763
- 32
764
- 33</pre>
1090
+ 63
1091
+ 64
1092
+ 65</pre>
765
1093
  </td>
766
1094
  <td>
767
- <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 31</span>
1095
+ <pre class="code"><span class="info file"># File 'lib/inquery/query.rb', line 63</span>
768
1096
 
769
1097
  <span class='kw'>def</span> <span class='id identifier rubyid_run'>run</span>
770
1098
  <span class='id identifier rubyid_process'>process</span><span class='lparen'>(</span><span class='id identifier rubyid_call'>call</span><span class='rparen'>)</span>
@@ -779,9 +1107,9 @@ easyer access.</p>
779
1107
  </div>
780
1108
 
781
1109
  <div id="footer">
782
- Generated on Thu Aug 24 11:11:23 2023 by
783
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
784
- 0.9.27 (ruby-3.0.1).
1110
+ Generated on Mon Jan 5 14:06:48 2026 by
1111
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
1112
+ 0.9.37 (ruby-3.3.5).
785
1113
  </div>
786
1114
 
787
1115
  </div>