qo 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. checksums.yaml +5 -5
  2. data/.yardopts +3 -0
  3. data/README.md +35 -2
  4. data/Rakefile +65 -13
  5. data/docs/Qo.html +165 -0
  6. data/docs/Qo/Exceptions.html +160 -0
  7. data/docs/Qo/Exceptions/MultipleMatchersProvided.html +257 -0
  8. data/docs/Qo/Exceptions/NoMatchersProvided.html +257 -0
  9. data/docs/Qo/Exceptions/NotAllGuardMatchersProvided.html +260 -0
  10. data/docs/Qo/Helpers.html +382 -0
  11. data/docs/Qo/Matchers.html +169 -0
  12. data/docs/Qo/Matchers/ArrayMatcher.html +459 -0
  13. data/docs/Qo/Matchers/BaseMatcher.html +493 -0
  14. data/docs/Qo/Matchers/GuardBlockMatcher.html +471 -0
  15. data/docs/Qo/Matchers/HashMatcher.html +445 -0
  16. data/docs/Qo/Matchers/PatternMatch.html +551 -0
  17. data/docs/Qo/PublicApi.html +867 -0
  18. data/docs/_index.html +258 -0
  19. data/docs/class_list.html +51 -0
  20. data/docs/css/common.css +1 -0
  21. data/docs/css/full_list.css +58 -0
  22. data/docs/css/style.css +499 -0
  23. data/docs/file.README.html +701 -0
  24. data/docs/file_list.html +56 -0
  25. data/docs/frames.html +17 -0
  26. data/docs/img/qo_logo.png +0 -0
  27. data/docs/index.html +701 -0
  28. data/docs/js/app.js +248 -0
  29. data/docs/js/full_list.js +216 -0
  30. data/docs/js/jquery.js +4 -0
  31. data/docs/method_list.html +227 -0
  32. data/docs/top-level-namespace.html +110 -0
  33. data/img/whoa_lemur.png +0 -0
  34. data/lib/qo/exceptions.rb +8 -4
  35. data/lib/qo/matchers/array_matcher.rb +34 -12
  36. data/lib/qo/matchers/base_matcher.rb +26 -11
  37. data/lib/qo/matchers/guard_block_matcher.rb +17 -3
  38. data/lib/qo/matchers/hash_matcher.rb +32 -23
  39. data/lib/qo/matchers/pattern_match.rb +2 -1
  40. data/lib/qo/public_api.rb +6 -5
  41. data/lib/qo/version.rb +1 -1
  42. data/performance_report.txt +73 -24
  43. data/qo.gemspec +2 -0
  44. metadata +61 -3
@@ -0,0 +1,493 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>
7
+ Class: Qo::Matchers::BaseMatcher
8
+
9
+ &mdash; Documentation by YARD 0.9.12
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
+ pathId = "Qo::Matchers::BaseMatcher";
19
+ relpath = '../../';
20
+ </script>
21
+
22
+
23
+ <script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
24
+
25
+ <script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
26
+
27
+
28
+ </head>
29
+ <body>
30
+ <div class="nav_wrap">
31
+ <iframe id="nav" src="../../class_list.html?1"></iframe>
32
+ <div id="resizer"></div>
33
+ </div>
34
+
35
+ <div id="main" tabindex="-1">
36
+ <div id="header">
37
+ <div id="menu">
38
+
39
+ <a href="../../_index.html">Index (B)</a> &raquo;
40
+ <span class='title'><span class='object_link'><a href="../../Qo.html" title="Qo (module)">Qo</a></span></span> &raquo; <span class='title'><span class='object_link'><a href="../Matchers.html" title="Qo::Matchers (module)">Matchers</a></span></span>
41
+ &raquo;
42
+ <span class="title">BaseMatcher</span>
43
+
44
+ </div>
45
+
46
+ <div id="search">
47
+
48
+ <a class="full_list_link" id="class_list_link"
49
+ href="../../class_list.html">
50
+
51
+ <svg width="24" height="24">
52
+ <rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
53
+ <rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
54
+ <rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
55
+ </svg>
56
+ </a>
57
+
58
+ </div>
59
+ <div class="clear"></div>
60
+ </div>
61
+
62
+ <div id="content"><h1>Class: Qo::Matchers::BaseMatcher
63
+
64
+
65
+
66
+ </h1>
67
+ <div class="box_info">
68
+
69
+ <dl>
70
+ <dt>Inherits:</dt>
71
+ <dd>
72
+ <span class="inheritName">Object</span>
73
+
74
+ <ul class="fullTree">
75
+ <li>Object</li>
76
+
77
+ <li class="next">Qo::Matchers::BaseMatcher</li>
78
+
79
+ </ul>
80
+ <a href="#" class="inheritanceTree">show all</a>
81
+
82
+ </dd>
83
+ </dl>
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+ <dl>
96
+ <dt>Defined in:</dt>
97
+ <dd>lib/qo/matchers/base_matcher.rb</dd>
98
+ </dl>
99
+
100
+ </div>
101
+
102
+ <h2>Overview</h2><div class="docstring">
103
+ <div class="discussion">
104
+ <p>Base instance of matcher which is meant to take in either Array style or
105
+ Keyword style arguments to run a match against various datatypes.</p>
106
+
107
+ <p>Will delegate responsibilities to either Array or Hash style matchers if
108
+ invoked directly.</p>
109
+
110
+
111
+ </div>
112
+ </div>
113
+ <div class="tags">
114
+
115
+ <p class="tag_title">Author:</p>
116
+ <ul class="author">
117
+
118
+ <li>
119
+
120
+
121
+
122
+
123
+
124
+ <div class='inline'><p>baweaver</p>
125
+ </div>
126
+
127
+ </li>
128
+
129
+ </ul>
130
+ <p class="tag_title">Since:</p>
131
+ <ul class="since">
132
+
133
+ <li>
134
+
135
+
136
+
137
+
138
+
139
+ <div class='inline'><p>0.2.0</p>
140
+ </div>
141
+
142
+ </li>
143
+
144
+ </ul>
145
+
146
+ </div><div id="subclasses">
147
+ <h2>Direct Known Subclasses</h2>
148
+ <p class="children"><span class='object_link'><a href="ArrayMatcher.html" title="Qo::Matchers::ArrayMatcher (class)">ArrayMatcher</a></span>, <span class='object_link'><a href="GuardBlockMatcher.html" title="Qo::Matchers::GuardBlockMatcher (class)">GuardBlockMatcher</a></span>, <span class='object_link'><a href="HashMatcher.html" title="Qo::Matchers::HashMatcher (class)">HashMatcher</a></span></p>
149
+ </div>
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+ <h2>
159
+ Instance Method Summary
160
+ <small><a href="#" class="summary_toggle">collapse</a></small>
161
+ </h2>
162
+
163
+ <ul class="summary">
164
+
165
+ <li class="public ">
166
+ <span class="summary_signature">
167
+
168
+ <a href="#call-instance_method" title="#call (instance method)">#<strong>call</strong>(target) &#x21d2; Boolean </a>
169
+
170
+
171
+
172
+ (also: #===, #[])
173
+
174
+ </span>
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+ <span class="summary_desc"><div class='inline'><p>You can directly call a matcher as well, much like a Proc, using one of call, ===, or [].</p>
185
+ </div></span>
186
+
187
+ </li>
188
+
189
+
190
+ <li class="public ">
191
+ <span class="summary_signature">
192
+
193
+ <a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(type, *array_matchers, **keyword_matchers) &#x21d2; BaseMatcher </a>
194
+
195
+
196
+
197
+ </span>
198
+
199
+
200
+ <span class="note title constructor">constructor</span>
201
+
202
+
203
+
204
+
205
+
206
+
207
+
208
+
209
+ <span class="summary_desc"><div class='inline'><p>A new instance of BaseMatcher.</p>
210
+ </div></span>
211
+
212
+ </li>
213
+
214
+
215
+ <li class="public ">
216
+ <span class="summary_signature">
217
+
218
+ <a href="#to_proc-instance_method" title="#to_proc (instance method)">#<strong>to_proc</strong> &#x21d2; Proc[Any] </a>
219
+
220
+
221
+
222
+ </span>
223
+
224
+
225
+
226
+
227
+
228
+
229
+
230
+
231
+
232
+ <span class="summary_desc"><div class='inline'><p>Converts a Matcher to a proc for use in querying, such as:.</p>
233
+ </div></span>
234
+
235
+ </li>
236
+
237
+
238
+ </ul>
239
+
240
+
241
+ <div id="constructor_details" class="method_details_list">
242
+ <h2>Constructor Details</h2>
243
+
244
+ <div class="method_details first">
245
+ <h3 class="signature first" id="initialize-instance_method">
246
+
247
+ #<strong>initialize</strong>(type, *array_matchers, **keyword_matchers) &#x21d2; <tt><span class='object_link'><a href="" title="Qo::Matchers::BaseMatcher (class)">BaseMatcher</a></span></tt>
248
+
249
+
250
+
251
+
252
+
253
+ </h3><div class="docstring">
254
+ <div class="discussion">
255
+ <p>Returns a new instance of BaseMatcher</p>
256
+
257
+
258
+ </div>
259
+ </div>
260
+ <div class="tags">
261
+
262
+ <p class="tag_title">Since:</p>
263
+ <ul class="since">
264
+
265
+ <li>
266
+
267
+
268
+
269
+
270
+
271
+ <div class='inline'><p>0.2.0</p>
272
+ </div>
273
+
274
+ </li>
275
+
276
+ </ul>
277
+
278
+ </div><table class="source_code">
279
+ <tr>
280
+ <td>
281
+ <pre class="lines">
282
+
283
+
284
+ 25
285
+ 26
286
+ 27
287
+ 28
288
+ 29</pre>
289
+ </td>
290
+ <td>
291
+ <pre class="code"><span class="info file"># File 'lib/qo/matchers/base_matcher.rb', line 25</span>
292
+
293
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='op'>*</span><span class='id identifier rubyid_array_matchers'>array_matchers</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_keyword_matchers'>keyword_matchers</span><span class='rparen'>)</span>
294
+ <span class='ivar'>@array_matchers</span> <span class='op'>=</span> <span class='id identifier rubyid_array_matchers'>array_matchers</span>
295
+ <span class='ivar'>@keyword_matchers</span> <span class='op'>=</span> <span class='id identifier rubyid_keyword_matchers'>keyword_matchers</span>
296
+ <span class='ivar'>@type</span> <span class='op'>=</span> <span class='id identifier rubyid_type'>type</span>
297
+ <span class='kw'>end</span></pre>
298
+ </td>
299
+ </tr>
300
+ </table>
301
+ </div>
302
+
303
+ </div>
304
+
305
+
306
+ <div id="instance_method_details" class="method_details_list">
307
+ <h2>Instance Method Details</h2>
308
+
309
+
310
+ <div class="method_details first">
311
+ <h3 class="signature first" id="call-instance_method">
312
+
313
+ #<strong>call</strong>(target) &#x21d2; <tt>Boolean</tt>
314
+
315
+
316
+
317
+ <span class="aliases">Also known as:
318
+ <span class="names"><span id='===-instance_method'>===</span>, <span id='[]-instance_method'>[]</span></span>
319
+ </span>
320
+
321
+
322
+
323
+ </h3><div class="docstring">
324
+ <div class="discussion">
325
+ <p>You can directly call a matcher as well, much like a Proc,
326
+ using one of call, ===, or []</p>
327
+
328
+
329
+ </div>
330
+ </div>
331
+ <div class="tags">
332
+ <p class="tag_title">Parameters:</p>
333
+ <ul class="param">
334
+
335
+ <li>
336
+
337
+ <span class='name'>target</span>
338
+
339
+
340
+ <span class='type'>(<tt>Any</tt>)</span>
341
+
342
+
343
+
344
+ &mdash;
345
+ <div class='inline'><p>Object to match against</p>
346
+ </div>
347
+
348
+ </li>
349
+
350
+ </ul>
351
+
352
+ <p class="tag_title">Returns:</p>
353
+ <ul class="return">
354
+
355
+ <li>
356
+
357
+
358
+ <span class='type'>(<tt>Boolean</tt>)</span>
359
+
360
+
361
+
362
+ &mdash;
363
+ <div class='inline'><p>Result of the match</p>
364
+ </div>
365
+
366
+ </li>
367
+
368
+ </ul>
369
+ <p class="tag_title">Since:</p>
370
+ <ul class="since">
371
+
372
+ <li>
373
+
374
+
375
+
376
+
377
+
378
+ <div class='inline'><p>0.2.0</p>
379
+ </div>
380
+
381
+ </li>
382
+
383
+ </ul>
384
+
385
+ </div><table class="source_code">
386
+ <tr>
387
+ <td>
388
+ <pre class="lines">
389
+
390
+
391
+ 48
392
+ 49
393
+ 50</pre>
394
+ </td>
395
+ <td>
396
+ <pre class="code"><span class="info file"># File 'lib/qo/matchers/base_matcher.rb', line 48</span>
397
+
398
+ <span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
399
+ <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_to_proc'>to_proc</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='rparen'>)</span>
400
+ <span class='kw'>end</span></pre>
401
+ </td>
402
+ </tr>
403
+ </table>
404
+ </div>
405
+
406
+ <div class="method_details ">
407
+ <h3 class="signature " id="to_proc-instance_method">
408
+
409
+ #<strong>to_proc</strong> &#x21d2; <tt>Proc[Any]</tt>
410
+
411
+
412
+
413
+
414
+
415
+ </h3><div class="docstring">
416
+ <div class="discussion">
417
+ <p>Converts a Matcher to a proc for use in querying, such as:</p>
418
+
419
+ <pre class="code ruby"><code class="ruby">data.select(&amp;Qo[...])
420
+ </code></pre>
421
+
422
+
423
+ </div>
424
+ </div>
425
+ <div class="tags">
426
+
427
+ <p class="tag_title">Returns:</p>
428
+ <ul class="return">
429
+
430
+ <li>
431
+
432
+
433
+ <span class='type'>(<tt>Proc[Any]</tt>)</span>
434
+
435
+
436
+
437
+ </li>
438
+
439
+ </ul>
440
+ <p class="tag_title">Since:</p>
441
+ <ul class="since">
442
+
443
+ <li>
444
+
445
+
446
+
447
+
448
+
449
+ <div class='inline'><p>0.2.0</p>
450
+ </div>
451
+
452
+ </li>
453
+
454
+ </ul>
455
+
456
+ </div><table class="source_code">
457
+ <tr>
458
+ <td>
459
+ <pre class="lines">
460
+
461
+
462
+ 36
463
+ 37
464
+ 38
465
+ 39
466
+ 40</pre>
467
+ </td>
468
+ <td>
469
+ <pre class="code"><span class="info file"># File 'lib/qo/matchers/base_matcher.rb', line 36</span>
470
+
471
+ <span class='kw'>def</span> <span class='id identifier rubyid_to_proc'>to_proc</span>
472
+ <span class='ivar'>@array_matchers</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span> <span class='op'>?</span>
473
+ <span class='const'><span class='object_link'><a href="../../Qo.html" title="Qo (module)">Qo</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Matchers.html" title="Qo::Matchers (module)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="HashMatcher.html" title="Qo::Matchers::HashMatcher (class)">HashMatcher</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Qo::Matchers::BaseMatcher#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@type</span><span class='comma'>,</span> <span class='op'>**</span><span class='ivar'>@keyword_matchers</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_proc'>to_proc</span> <span class='op'>:</span>
474
+ <span class='const'><span class='object_link'><a href="../../Qo.html" title="Qo (module)">Qo</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Matchers.html" title="Qo::Matchers (module)">Matchers</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="ArrayMatcher.html" title="Qo::Matchers::ArrayMatcher (class)">ArrayMatcher</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="#initialize-instance_method" title="Qo::Matchers::BaseMatcher#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='ivar'>@type</span><span class='comma'>,</span> <span class='op'>*</span><span class='ivar'>@array_matchers</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_proc'>to_proc</span>
475
+ <span class='kw'>end</span></pre>
476
+ </td>
477
+ </tr>
478
+ </table>
479
+ </div>
480
+
481
+ </div>
482
+
483
+ </div>
484
+
485
+ <div id="footer">
486
+ Generated on Sun Apr 15 20:29:44 2018 by
487
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
488
+ 0.9.12 (ruby-2.4.4).
489
+ </div>
490
+
491
+ </div>
492
+ </body>
493
+ </html>