brauser 2.1.4 → 3.0.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.
- data/Gemfile +3 -3
- data/README.md +3 -3
- data/brauser.gemspec +1 -1
- data/doc/Brauser.html +6 -5
- data/doc/Brauser/Browser.html +553 -541
- data/doc/Brauser/BrowserMethods.html +1 -1
- data/doc/Brauser/BrowserMethods/Attributes.html +21 -21
- data/doc/Brauser/BrowserMethods/General.html +1 -1
- data/doc/Brauser/BrowserMethods/General/ClassMethods.html +29 -29
- data/doc/Brauser/BrowserMethods/Parsing.html +15 -15
- data/doc/Brauser/BrowserMethods/PartialQuerying.html +45 -55
- data/doc/Brauser/BrowserMethods/Querying.html +21 -21
- data/doc/Brauser/BrowserMethods/Register.html +1 -1
- data/doc/Brauser/BrowserMethods/Register/ClassMethods.html +116 -425
- data/doc/Brauser/Hooks.html +1 -1
- data/doc/Brauser/Hooks/RubyOnRails.html +2 -2
- data/doc/Brauser/Query.html +45 -1267
- data/doc/Brauser/Version.html +4 -4
- data/doc/_index.html +33 -4
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +4 -4
- data/doc/index.html +4 -4
- data/doc/method_list.html +89 -65
- data/doc/top-level-namespace.html +1 -1
- data/lib/brauser.rb +1 -0
- data/lib/brauser/browser.rb +163 -234
- data/lib/brauser/definition.rb +54 -0
- data/lib/brauser/hooks.rb +1 -1
- data/lib/brauser/query.rb +68 -59
- data/lib/brauser/version.rb +3 -3
- data/spec/brauser/browser_spec.rb +222 -292
- data/spec/brauser/definition_spec.rb +39 -0
- data/spec/brauser/hooks_spec.rb +2 -3
- data/spec/brauser/query_spec.rb +29 -33
- metadata +8 -5
data/doc/Brauser/Hooks.html
CHANGED
@@ -116,7 +116,7 @@
|
|
116
116
|
</div>
|
117
117
|
|
118
118
|
<div id="footer">
|
119
|
-
Generated on
|
119
|
+
Generated on Sun May 19 12:02:56 2013 by
|
120
120
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
121
121
|
0.8.6.1 (ruby-1.9.3).
|
122
122
|
</div>
|
@@ -225,7 +225,7 @@
|
|
225
225
|
<pre class="code"><span class="info file"># File 'lib/brauser/hooks.rb', line 15</span>
|
226
226
|
|
227
227
|
<span class='kw'>def</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_included'>included</span><span class='lparen'>(</span><span class='id identifier rubyid_base'>base</span><span class='rparen'>)</span>
|
228
|
-
<span class='id identifier rubyid_base'>base</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span>
|
228
|
+
<span class='id identifier rubyid_base'>base</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='symbol'>:helper_method</span><span class='comma'>,</span> <span class='symbol'>:browser</span><span class='rparen'>)</span>
|
229
229
|
<span class='kw'>end</span></pre>
|
230
230
|
</td>
|
231
231
|
</tr>
|
@@ -323,7 +323,7 @@
|
|
323
323
|
</div>
|
324
324
|
|
325
325
|
<div id="footer">
|
326
|
-
Generated on
|
326
|
+
Generated on Sun May 19 12:02:56 2013 by
|
327
327
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
328
328
|
0.8.6.1 (ruby-1.9.3).
|
329
329
|
</div>
|
data/doc/Brauser/Query.html
CHANGED
@@ -90,11 +90,15 @@
|
|
90
90
|
|
91
91
|
|
92
92
|
|
93
|
+
<dt class="r2">Includes:</dt>
|
94
|
+
<dd class="r2"><span class='object_link'><a href="Chainers.html" title="Brauser::Chainers (module)">Chainers</a></span>, <span class='object_link'><a href="Queries.html" title="Brauser::Queries (module)">Queries</a></span></dd>
|
95
|
+
|
96
|
+
|
93
97
|
|
94
98
|
|
95
99
|
|
96
|
-
<dt class="
|
97
|
-
<dd class="
|
100
|
+
<dt class="r1 last">Defined in:</dt>
|
101
|
+
<dd class="r1 last">lib/brauser/query.rb</dd>
|
98
102
|
|
99
103
|
</dl>
|
100
104
|
<div class="clear"></div>
|
@@ -190,52 +194,6 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
|
|
190
194
|
<li class="public ">
|
191
195
|
<span class="summary_signature">
|
192
196
|
|
193
|
-
<a href="#accepts-instance_method" title="#accepts (instance method)">- (Query) <strong>accepts</strong>(langs = []) </a>
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
</span>
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
<span class="summary_desc"><div class='inline'><p>Check if the browser accepts the specified languages.</p>
|
208
|
-
</div></span>
|
209
|
-
|
210
|
-
</li>
|
211
|
-
|
212
|
-
|
213
|
-
<li class="public ">
|
214
|
-
<span class="summary_signature">
|
215
|
-
|
216
|
-
<a href="#accepts%3F-instance_method" title="#accepts? (instance method)">- (Boolean) <strong>accepts?</strong>(langs = []) </a>
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
</span>
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
<span class="summary_desc"><div class='inline'><p>Check if the browser accepts the specified languages.</p>
|
231
|
-
</div></span>
|
232
|
-
|
233
|
-
</li>
|
234
|
-
|
235
|
-
|
236
|
-
<li class="public ">
|
237
|
-
<span class="summary_signature">
|
238
|
-
|
239
197
|
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Query) <strong>initialize</strong>(target, result = true) </a>
|
240
198
|
|
241
199
|
|
@@ -258,147 +216,31 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
|
|
258
216
|
</li>
|
259
217
|
|
260
218
|
|
261
|
-
|
262
|
-
<span class="summary_signature">
|
263
|
-
|
264
|
-
<a href="#is-instance_method" title="#is (instance method)">- (Query) <strong>is</strong>(names = [], versions = {}, platforms = []) </a>
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
</span>
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
<span class="summary_desc"><div class='inline'><p>Checks if the browser is a specific name and optionally of a specific version and platform.</p>
|
279
|
-
</div></span>
|
280
|
-
|
281
|
-
</li>
|
282
|
-
|
283
|
-
|
284
|
-
<li class="public ">
|
285
|
-
<span class="summary_signature">
|
286
|
-
|
287
|
-
<a href="#is%3F-instance_method" title="#is? (instance method)">- (Boolean) <strong>is?</strong>(names = [], versions = {}, platforms = []) </a>
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
</span>
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
<span class="summary_desc"><div class='inline'><p>Checks if the browser is a specific name and optionally of a specific version and platform.</p>
|
302
|
-
</div></span>
|
303
|
-
|
304
|
-
</li>
|
305
|
-
|
306
|
-
|
307
|
-
<li class="public ">
|
308
|
-
<span class="summary_signature">
|
309
|
-
|
310
|
-
<a href="#on-instance_method" title="#on (instance method)">- (Query) <strong>on</strong>(platforms = []) </a>
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
</span>
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
<span class="summary_desc"><div class='inline'><p>Check if the browser is on a specific platform.</p>
|
325
|
-
</div></span>
|
326
|
-
|
327
|
-
</li>
|
328
|
-
|
329
|
-
|
330
|
-
<li class="public ">
|
331
|
-
<span class="summary_signature">
|
332
|
-
|
333
|
-
<a href="#on%3F-instance_method" title="#on? (instance method)">- (Boolean) <strong>on?</strong>(platforms = []) </a>
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
</span>
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
<span class="summary_desc"><div class='inline'><p>Check if the browser is on a specific platform.</p>
|
348
|
-
</div></span>
|
219
|
+
</ul>
|
349
220
|
|
350
|
-
</li>
|
351
221
|
|
352
|
-
|
353
|
-
<li class="public ">
|
354
|
-
<span class="summary_signature">
|
355
|
-
|
356
|
-
<a href="#v-instance_method" title="#v (instance method)">- (Query) <strong>v</strong>(versions = {}) </a>
|
357
|
-
|
358
222
|
|
359
|
-
|
360
|
-
</span>
|
361
|
-
|
362
223
|
|
363
224
|
|
364
225
|
|
365
226
|
|
366
227
|
|
367
228
|
|
368
|
-
|
369
229
|
|
370
|
-
<span class="summary_desc"><div class='inline'><p>Checks if the browser is a specific version.</p>
|
371
|
-
</div></span>
|
372
230
|
|
373
|
-
</
|
374
|
-
|
375
|
-
|
376
|
-
<li class="public ">
|
377
|
-
<span class="summary_signature">
|
378
|
-
|
379
|
-
<a href="#v%3F-instance_method" title="#v? (instance method)">- (Boolean) <strong>v?</strong>(versions = {}) </a>
|
380
|
-
|
231
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Queries.html" title="Brauser::Queries (module)">Queries</a></span></h3>
|
232
|
+
<p class="inherited"><span class='object_link'><a href="Queries.html#accepts%3F-instance_method" title="Brauser::Queries#accepts? (method)">#accepts?</a></span>, <span class='object_link'><a href="Queries.html#is%3F-instance_method" title="Brauser::Queries#is? (method)">#is?</a></span>, <span class='object_link'><a href="Queries.html#on%3F-instance_method" title="Brauser::Queries#on? (method)">#on?</a></span>, <span class='object_link'><a href="Queries.html#v%3F-instance_method" title="Brauser::Queries#v? (method)">#v?</a></span></p>
|
381
233
|
|
382
|
-
|
383
|
-
</span>
|
384
|
-
|
385
234
|
|
386
235
|
|
387
236
|
|
388
237
|
|
389
238
|
|
390
239
|
|
391
|
-
|
392
|
-
|
393
|
-
<span class="summary_desc"><div class='inline'><p>Checks if the browser is a specific version.</p>
|
394
|
-
</div></span>
|
395
240
|
|
396
|
-
</li>
|
397
|
-
|
398
|
-
|
399
|
-
</ul>
|
400
241
|
|
401
|
-
|
242
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Chainers.html" title="Brauser::Chainers (module)">Chainers</a></span></h3>
|
243
|
+
<p class="inherited"><span class='object_link'><a href="Chainers.html#accepts-instance_method" title="Brauser::Chainers#accepts (method)">#accepts</a></span>, <span class='object_link'><a href="Chainers.html#is-instance_method" title="Brauser::Chainers#is (method)">#is</a></span>, <span class='object_link'><a href="Chainers.html#on-instance_method" title="Brauser::Chainers#on (method)">#on</a></span>, <span class='object_link'><a href="Chainers.html#v-instance_method" title="Brauser::Chainers#v (method)">#v</a></span></p>
|
402
244
|
<div id="constructor_details" class="method_details_list">
|
403
245
|
<h2>Constructor Details</h2>
|
404
246
|
|
@@ -463,13 +305,13 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
|
|
463
305
|
<pre class="lines">
|
464
306
|
|
465
307
|
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
308
|
+
124
|
309
|
+
125
|
310
|
+
126
|
311
|
+
127</pre>
|
470
312
|
</td>
|
471
313
|
<td>
|
472
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line
|
314
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line 124</span>
|
473
315
|
|
474
316
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_target'>target</span><span class='comma'>,</span> <span class='id identifier rubyid_result'>result</span> <span class='op'>=</span> <span class='kw'>true</span><span class='rparen'>)</span>
|
475
317
|
<span class='ivar'>@target</span> <span class='op'>=</span> <span class='id identifier rubyid_target'>target</span>
|
@@ -529,113 +371,33 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
|
|
529
371
|
<pre class="lines">
|
530
372
|
|
531
373
|
|
532
|
-
21
|
533
|
-
22
|
534
|
-
23
|
535
|
-
24
|
536
|
-
25
|
537
|
-
26
|
538
|
-
27
|
539
|
-
28
|
540
|
-
29
|
541
|
-
30
|
542
|
-
31
|
543
|
-
32
|
544
|
-
33
|
545
|
-
34
|
546
|
-
35
|
547
|
-
36
|
548
|
-
37
|
549
|
-
38
|
550
|
-
39
|
551
|
-
40
|
552
|
-
41
|
553
|
-
42
|
554
|
-
43
|
555
|
-
44
|
556
|
-
45
|
557
|
-
46
|
558
|
-
47
|
559
|
-
48
|
560
|
-
49
|
561
|
-
50
|
562
|
-
51
|
563
|
-
52
|
564
|
-
53
|
565
|
-
54
|
566
|
-
55
|
567
|
-
56
|
568
|
-
57
|
569
|
-
58
|
570
|
-
59
|
571
|
-
60
|
572
|
-
61
|
573
|
-
62
|
574
|
-
63
|
575
|
-
64
|
576
|
-
65
|
577
|
-
66
|
578
|
-
67
|
579
|
-
68
|
580
|
-
69
|
581
|
-
70
|
582
|
-
71
|
583
|
-
72
|
584
|
-
73
|
585
|
-
74
|
586
|
-
75
|
587
|
-
76
|
588
|
-
77
|
589
|
-
78
|
590
|
-
79
|
591
|
-
80
|
592
|
-
81
|
593
|
-
82
|
594
|
-
83
|
595
|
-
84
|
596
|
-
85
|
597
|
-
86
|
598
|
-
87
|
599
|
-
88
|
600
|
-
89
|
601
|
-
90
|
602
|
-
91
|
603
|
-
92
|
604
|
-
93
|
605
|
-
94
|
606
|
-
95
|
607
|
-
96
|
608
|
-
97
|
609
|
-
98
|
610
|
-
99
|
611
|
-
100
|
612
|
-
101
|
613
|
-
102
|
614
|
-
103
|
615
|
-
104
|
616
|
-
105
|
617
|
-
106
|
618
|
-
107
|
619
|
-
108
|
620
|
-
109
|
621
|
-
110
|
622
|
-
111
|
623
|
-
112
|
624
374
|
113
|
625
375
|
114
|
626
376
|
115
|
627
377
|
116
|
628
378
|
117
|
629
379
|
118
|
630
|
-
119
|
380
|
+
119
|
381
|
+
120
|
382
|
+
121
|
383
|
+
122
|
384
|
+
123
|
385
|
+
124
|
386
|
+
125
|
387
|
+
126
|
388
|
+
127
|
389
|
+
128</pre>
|
631
390
|
</td>
|
632
391
|
<td>
|
633
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line
|
392
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line 113</span>
|
634
393
|
|
635
394
|
<span class='kw'>class</span> <span class='const'>Query</span>
|
636
395
|
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:target</span>
|
637
396
|
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:result</span>
|
638
397
|
|
398
|
+
<span class='id identifier rubyid_include'>include</span> <span class='const'>Brauser</span><span class='op'>::</span><span class='const'>Chainers</span>
|
399
|
+
<span class='id identifier rubyid_include'>include</span> <span class='const'>Brauser</span><span class='op'>::</span><span class='const'>Queries</span>
|
400
|
+
|
639
401
|
<span class='comment'># Creates a new query.
|
640
402
|
</span> <span class='comment'>#
|
641
403
|
</span> <span class='comment'># @param target [Browser] The current browser.
|
@@ -644,92 +406,6 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
|
|
644
406
|
<span class='ivar'>@target</span> <span class='op'>=</span> <span class='id identifier rubyid_target'>target</span>
|
645
407
|
<span class='ivar'>@result</span> <span class='op'>=</span> <span class='id identifier rubyid_result'>result</span>
|
646
408
|
<span class='kw'>end</span>
|
647
|
-
|
648
|
-
<span class='comment'># Checks if the browser is a specific name and optionally of a specific version and platform.
|
649
|
-
</span> <span class='comment'>#
|
650
|
-
</span> <span class='comment'># @see #version?
|
651
|
-
</span> <span class='comment'># @see #on?
|
652
|
-
</span> <span class='comment'>#
|
653
|
-
</span> <span class='comment'># @param names [Symbol|Array] A list of specific names to match. Also, this meta-names are supported: `:capable` and `:tablet`.
|
654
|
-
</span> <span class='comment'># @param versions [Hash] An hash with specific version to match against. Need to be in any form that {#v} understands.
|
655
|
-
</span> <span class='comment'># @param platforms [Symbol|Array] A list of specific platform to match. Valid values are all those possible for the platform attribute.
|
656
|
-
</span> <span class='comment'># @return [Query] The query itself.
|
657
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_is'>is</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
658
|
-
<span class='ivar'>@result</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is?'>is?</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span><span class='rparen'>)</span>
|
659
|
-
<span class='kw'>self</span>
|
660
|
-
<span class='kw'>end</span>
|
661
|
-
|
662
|
-
<span class='comment'># Checks if the browser is a specific name and optionally of a specific version and platform.
|
663
|
-
</span> <span class='comment'>#
|
664
|
-
</span> <span class='comment'># This version returns a boolean and it is equal to append a call to {#result} to the method {#is}.
|
665
|
-
</span> <span class='comment'>#
|
666
|
-
</span> <span class='comment'># @see #version?
|
667
|
-
</span> <span class='comment'># @see #on?
|
668
|
-
</span> <span class='comment'>#
|
669
|
-
</span> <span class='comment'># @param names [Symbol|Array] A list of specific names to match. Also, this meta-names are supported: `:capable` and `:tablet`.
|
670
|
-
</span> <span class='comment'># @param versions [Hash] An hash with specific version to match against. Need to be in any form that {#v} understands.
|
671
|
-
</span> <span class='comment'># @param platforms [Symbol|Array] A list of specific platform to match. Valid values are all those possible for the platform attribute.
|
672
|
-
</span> <span class='comment'># @return [Boolean] `true` if current browser matches, `false` otherwise.
|
673
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_is?'>is?</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
674
|
-
<span class='ivar'>@result</span> <span class='op'>?</span> <span class='ivar'>@target</span><span class='period'>.</span><span class='id identifier rubyid_is?'>is?</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='ivar'>@result</span>
|
675
|
-
<span class='kw'>end</span>
|
676
|
-
|
677
|
-
<span class='comment'># Checks if the browser is a specific version.
|
678
|
-
</span> <span class='comment'>#
|
679
|
-
</span> <span class='comment'># @param versions [String|Hash] A string in the form `operator version && ...` (example: `>= 7 && < 4`) or an hash with specific version to match against, in form `{:operator => version}`, where operator is one of `:lt, :lte, :eq, :gt, :gte`.
|
680
|
-
</span> <span class='comment'># @return [Query] The query itself.
|
681
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_v'>v</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
682
|
-
<span class='ivar'>@result</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_v?'>v?</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span><span class='rparen'>)</span>
|
683
|
-
<span class='kw'>self</span>
|
684
|
-
<span class='kw'>end</span>
|
685
|
-
|
686
|
-
<span class='comment'># Checks if the browser is a specific version.
|
687
|
-
</span> <span class='comment'>#
|
688
|
-
</span> <span class='comment'># This version returns a boolean and it is equal to append a call to {#result} to the method {#v}.
|
689
|
-
</span> <span class='comment'>#
|
690
|
-
</span> <span class='comment'># @param versions [String|Hash] A string in the form `operator version && ...` (example: `>= 7 && < 4`) or an hash with specific version to match against, in form `{:operator => version}`, where operator is one of `:lt, :lte, :eq, :gt, :gte`.
|
691
|
-
</span> <span class='comment'># @return [Boolean] `true` if current browser matches, `false` otherwise.
|
692
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_v?'>v?</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
693
|
-
<span class='ivar'>@result</span> <span class='op'>?</span> <span class='ivar'>@target</span><span class='period'>.</span><span class='id identifier rubyid_v?'>v?</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='ivar'>@result</span>
|
694
|
-
<span class='kw'>end</span>
|
695
|
-
|
696
|
-
<span class='comment'># Check if the browser is on a specific platform.
|
697
|
-
</span> <span class='comment'>#
|
698
|
-
</span> <span class='comment'># @param platforms [Symbol|Array] A list of specific platform to match.
|
699
|
-
</span> <span class='comment'># @return [Query] The query itself.
|
700
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='id identifier rubyid_platforms'>platforms</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
701
|
-
<span class='ivar'>@result</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_on?'>on?</span><span class='lparen'>(</span><span class='id identifier rubyid_platforms'>platforms</span><span class='rparen'>)</span>
|
702
|
-
<span class='kw'>self</span>
|
703
|
-
<span class='kw'>end</span>
|
704
|
-
|
705
|
-
<span class='comment'># Check if the browser is on a specific platform.
|
706
|
-
</span> <span class='comment'>#
|
707
|
-
</span> <span class='comment'># This version returns a boolean and it is equal to append a call to {#result} to the method {#on}.
|
708
|
-
</span> <span class='comment'>#
|
709
|
-
</span> <span class='comment'># @param platforms [Symbol|Array] A list of specific platform to match.
|
710
|
-
</span> <span class='comment'># @return [Boolean] `true` if current browser matches, `false` otherwise.
|
711
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_on?'>on?</span><span class='lparen'>(</span><span class='id identifier rubyid_platforms'>platforms</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
712
|
-
<span class='ivar'>@result</span> <span class='op'>?</span> <span class='ivar'>@target</span><span class='period'>.</span><span class='id identifier rubyid_on?'>on?</span><span class='lparen'>(</span><span class='id identifier rubyid_platforms'>platforms</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='ivar'>@result</span>
|
713
|
-
<span class='kw'>end</span>
|
714
|
-
|
715
|
-
<span class='comment'># Check if the browser accepts the specified languages.
|
716
|
-
</span> <span class='comment'>#
|
717
|
-
</span> <span class='comment'># @param langs [String|Array] A list of languages to match against.
|
718
|
-
</span> <span class='comment'># @return [Query] The query itself.
|
719
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_accepts'>accepts</span><span class='lparen'>(</span><span class='id identifier rubyid_langs'>langs</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
720
|
-
<span class='ivar'>@result</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_accepts?'>accepts?</span><span class='lparen'>(</span><span class='id identifier rubyid_langs'>langs</span><span class='rparen'>)</span>
|
721
|
-
<span class='kw'>self</span>
|
722
|
-
<span class='kw'>end</span>
|
723
|
-
|
724
|
-
<span class='comment'># Check if the browser accepts the specified languages.
|
725
|
-
</span> <span class='comment'>#
|
726
|
-
</span> <span class='comment'># This version returns a boolean and it is equal to append a call to {#result} to the method {#accepts}.
|
727
|
-
</span> <span class='comment'>#
|
728
|
-
</span> <span class='comment'># @param langs [String|Array] A list of languages to match against.
|
729
|
-
</span> <span class='comment'># @return [Boolean] `true` if current browser matches, `false` otherwise.
|
730
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_accepts?'>accepts?</span><span class='lparen'>(</span><span class='id identifier rubyid_langs'>langs</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
731
|
-
<span class='ivar'>@result</span> <span class='op'>?</span> <span class='ivar'>@target</span><span class='period'>.</span><span class='id identifier rubyid_accepts?'>accepts?</span><span class='lparen'>(</span><span class='id identifier rubyid_langs'>langs</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='ivar'>@result</span>
|
732
|
-
<span class='kw'>end</span>
|
733
409
|
<span class='kw'>end</span></pre>
|
734
410
|
</td>
|
735
411
|
</tr>
|
@@ -780,113 +456,33 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
|
|
780
456
|
<pre class="lines">
|
781
457
|
|
782
458
|
|
783
|
-
21
|
784
|
-
22
|
785
|
-
23
|
786
|
-
24
|
787
|
-
25
|
788
|
-
26
|
789
|
-
27
|
790
|
-
28
|
791
|
-
29
|
792
|
-
30
|
793
|
-
31
|
794
|
-
32
|
795
|
-
33
|
796
|
-
34
|
797
|
-
35
|
798
|
-
36
|
799
|
-
37
|
800
|
-
38
|
801
|
-
39
|
802
|
-
40
|
803
|
-
41
|
804
|
-
42
|
805
|
-
43
|
806
|
-
44
|
807
|
-
45
|
808
|
-
46
|
809
|
-
47
|
810
|
-
48
|
811
|
-
49
|
812
|
-
50
|
813
|
-
51
|
814
|
-
52
|
815
|
-
53
|
816
|
-
54
|
817
|
-
55
|
818
|
-
56
|
819
|
-
57
|
820
|
-
58
|
821
|
-
59
|
822
|
-
60
|
823
|
-
61
|
824
|
-
62
|
825
|
-
63
|
826
|
-
64
|
827
|
-
65
|
828
|
-
66
|
829
|
-
67
|
830
|
-
68
|
831
|
-
69
|
832
|
-
70
|
833
|
-
71
|
834
|
-
72
|
835
|
-
73
|
836
|
-
74
|
837
|
-
75
|
838
|
-
76
|
839
|
-
77
|
840
|
-
78
|
841
|
-
79
|
842
|
-
80
|
843
|
-
81
|
844
|
-
82
|
845
|
-
83
|
846
|
-
84
|
847
|
-
85
|
848
|
-
86
|
849
|
-
87
|
850
|
-
88
|
851
|
-
89
|
852
|
-
90
|
853
|
-
91
|
854
|
-
92
|
855
|
-
93
|
856
|
-
94
|
857
|
-
95
|
858
|
-
96
|
859
|
-
97
|
860
|
-
98
|
861
|
-
99
|
862
|
-
100
|
863
|
-
101
|
864
|
-
102
|
865
|
-
103
|
866
|
-
104
|
867
|
-
105
|
868
|
-
106
|
869
|
-
107
|
870
|
-
108
|
871
|
-
109
|
872
|
-
110
|
873
|
-
111
|
874
|
-
112
|
875
459
|
113
|
876
460
|
114
|
877
461
|
115
|
878
462
|
116
|
879
463
|
117
|
880
464
|
118
|
881
|
-
119
|
465
|
+
119
|
466
|
+
120
|
467
|
+
121
|
468
|
+
122
|
469
|
+
123
|
470
|
+
124
|
471
|
+
125
|
472
|
+
126
|
473
|
+
127
|
474
|
+
128</pre>
|
882
475
|
</td>
|
883
476
|
<td>
|
884
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line
|
477
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line 113</span>
|
885
478
|
|
886
479
|
<span class='kw'>class</span> <span class='const'>Query</span>
|
887
480
|
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:target</span>
|
888
481
|
<span class='id identifier rubyid_attr_accessor'>attr_accessor</span> <span class='symbol'>:result</span>
|
889
482
|
|
483
|
+
<span class='id identifier rubyid_include'>include</span> <span class='const'>Brauser</span><span class='op'>::</span><span class='const'>Chainers</span>
|
484
|
+
<span class='id identifier rubyid_include'>include</span> <span class='const'>Brauser</span><span class='op'>::</span><span class='const'>Queries</span>
|
485
|
+
|
890
486
|
<span class='comment'># Creates a new query.
|
891
487
|
</span> <span class='comment'>#
|
892
488
|
</span> <span class='comment'># @param target [Browser] The current browser.
|
@@ -895,92 +491,6 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
|
|
895
491
|
<span class='ivar'>@target</span> <span class='op'>=</span> <span class='id identifier rubyid_target'>target</span>
|
896
492
|
<span class='ivar'>@result</span> <span class='op'>=</span> <span class='id identifier rubyid_result'>result</span>
|
897
493
|
<span class='kw'>end</span>
|
898
|
-
|
899
|
-
<span class='comment'># Checks if the browser is a specific name and optionally of a specific version and platform.
|
900
|
-
</span> <span class='comment'>#
|
901
|
-
</span> <span class='comment'># @see #version?
|
902
|
-
</span> <span class='comment'># @see #on?
|
903
|
-
</span> <span class='comment'>#
|
904
|
-
</span> <span class='comment'># @param names [Symbol|Array] A list of specific names to match. Also, this meta-names are supported: `:capable` and `:tablet`.
|
905
|
-
</span> <span class='comment'># @param versions [Hash] An hash with specific version to match against. Need to be in any form that {#v} understands.
|
906
|
-
</span> <span class='comment'># @param platforms [Symbol|Array] A list of specific platform to match. Valid values are all those possible for the platform attribute.
|
907
|
-
</span> <span class='comment'># @return [Query] The query itself.
|
908
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_is'>is</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
909
|
-
<span class='ivar'>@result</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is?'>is?</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span><span class='rparen'>)</span>
|
910
|
-
<span class='kw'>self</span>
|
911
|
-
<span class='kw'>end</span>
|
912
|
-
|
913
|
-
<span class='comment'># Checks if the browser is a specific name and optionally of a specific version and platform.
|
914
|
-
</span> <span class='comment'>#
|
915
|
-
</span> <span class='comment'># This version returns a boolean and it is equal to append a call to {#result} to the method {#is}.
|
916
|
-
</span> <span class='comment'>#
|
917
|
-
</span> <span class='comment'># @see #version?
|
918
|
-
</span> <span class='comment'># @see #on?
|
919
|
-
</span> <span class='comment'>#
|
920
|
-
</span> <span class='comment'># @param names [Symbol|Array] A list of specific names to match. Also, this meta-names are supported: `:capable` and `:tablet`.
|
921
|
-
</span> <span class='comment'># @param versions [Hash] An hash with specific version to match against. Need to be in any form that {#v} understands.
|
922
|
-
</span> <span class='comment'># @param platforms [Symbol|Array] A list of specific platform to match. Valid values are all those possible for the platform attribute.
|
923
|
-
</span> <span class='comment'># @return [Boolean] `true` if current browser matches, `false` otherwise.
|
924
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_is?'>is?</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
925
|
-
<span class='ivar'>@result</span> <span class='op'>?</span> <span class='ivar'>@target</span><span class='period'>.</span><span class='id identifier rubyid_is?'>is?</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='ivar'>@result</span>
|
926
|
-
<span class='kw'>end</span>
|
927
|
-
|
928
|
-
<span class='comment'># Checks if the browser is a specific version.
|
929
|
-
</span> <span class='comment'>#
|
930
|
-
</span> <span class='comment'># @param versions [String|Hash] A string in the form `operator version && ...` (example: `>= 7 && < 4`) or an hash with specific version to match against, in form `{:operator => version}`, where operator is one of `:lt, :lte, :eq, :gt, :gte`.
|
931
|
-
</span> <span class='comment'># @return [Query] The query itself.
|
932
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_v'>v</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
933
|
-
<span class='ivar'>@result</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_v?'>v?</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span><span class='rparen'>)</span>
|
934
|
-
<span class='kw'>self</span>
|
935
|
-
<span class='kw'>end</span>
|
936
|
-
|
937
|
-
<span class='comment'># Checks if the browser is a specific version.
|
938
|
-
</span> <span class='comment'>#
|
939
|
-
</span> <span class='comment'># This version returns a boolean and it is equal to append a call to {#result} to the method {#v}.
|
940
|
-
</span> <span class='comment'>#
|
941
|
-
</span> <span class='comment'># @param versions [String|Hash] A string in the form `operator version && ...` (example: `>= 7 && < 4`) or an hash with specific version to match against, in form `{:operator => version}`, where operator is one of `:lt, :lte, :eq, :gt, :gte`.
|
942
|
-
</span> <span class='comment'># @return [Boolean] `true` if current browser matches, `false` otherwise.
|
943
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_v?'>v?</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
944
|
-
<span class='ivar'>@result</span> <span class='op'>?</span> <span class='ivar'>@target</span><span class='period'>.</span><span class='id identifier rubyid_v?'>v?</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='ivar'>@result</span>
|
945
|
-
<span class='kw'>end</span>
|
946
|
-
|
947
|
-
<span class='comment'># Check if the browser is on a specific platform.
|
948
|
-
</span> <span class='comment'>#
|
949
|
-
</span> <span class='comment'># @param platforms [Symbol|Array] A list of specific platform to match.
|
950
|
-
</span> <span class='comment'># @return [Query] The query itself.
|
951
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='id identifier rubyid_platforms'>platforms</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
952
|
-
<span class='ivar'>@result</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_on?'>on?</span><span class='lparen'>(</span><span class='id identifier rubyid_platforms'>platforms</span><span class='rparen'>)</span>
|
953
|
-
<span class='kw'>self</span>
|
954
|
-
<span class='kw'>end</span>
|
955
|
-
|
956
|
-
<span class='comment'># Check if the browser is on a specific platform.
|
957
|
-
</span> <span class='comment'>#
|
958
|
-
</span> <span class='comment'># This version returns a boolean and it is equal to append a call to {#result} to the method {#on}.
|
959
|
-
</span> <span class='comment'>#
|
960
|
-
</span> <span class='comment'># @param platforms [Symbol|Array] A list of specific platform to match.
|
961
|
-
</span> <span class='comment'># @return [Boolean] `true` if current browser matches, `false` otherwise.
|
962
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_on?'>on?</span><span class='lparen'>(</span><span class='id identifier rubyid_platforms'>platforms</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
963
|
-
<span class='ivar'>@result</span> <span class='op'>?</span> <span class='ivar'>@target</span><span class='period'>.</span><span class='id identifier rubyid_on?'>on?</span><span class='lparen'>(</span><span class='id identifier rubyid_platforms'>platforms</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='ivar'>@result</span>
|
964
|
-
<span class='kw'>end</span>
|
965
|
-
|
966
|
-
<span class='comment'># Check if the browser accepts the specified languages.
|
967
|
-
</span> <span class='comment'>#
|
968
|
-
</span> <span class='comment'># @param langs [String|Array] A list of languages to match against.
|
969
|
-
</span> <span class='comment'># @return [Query] The query itself.
|
970
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_accepts'>accepts</span><span class='lparen'>(</span><span class='id identifier rubyid_langs'>langs</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
971
|
-
<span class='ivar'>@result</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_accepts?'>accepts?</span><span class='lparen'>(</span><span class='id identifier rubyid_langs'>langs</span><span class='rparen'>)</span>
|
972
|
-
<span class='kw'>self</span>
|
973
|
-
<span class='kw'>end</span>
|
974
|
-
|
975
|
-
<span class='comment'># Check if the browser accepts the specified languages.
|
976
|
-
</span> <span class='comment'>#
|
977
|
-
</span> <span class='comment'># This version returns a boolean and it is equal to append a call to {#result} to the method {#accepts}.
|
978
|
-
</span> <span class='comment'>#
|
979
|
-
</span> <span class='comment'># @param langs [String|Array] A list of languages to match against.
|
980
|
-
</span> <span class='comment'># @return [Boolean] `true` if current browser matches, `false` otherwise.
|
981
|
-
</span> <span class='kw'>def</span> <span class='id identifier rubyid_accepts?'>accepts?</span><span class='lparen'>(</span><span class='id identifier rubyid_langs'>langs</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
982
|
-
<span class='ivar'>@result</span> <span class='op'>?</span> <span class='ivar'>@target</span><span class='period'>.</span><span class='id identifier rubyid_accepts?'>accepts?</span><span class='lparen'>(</span><span class='id identifier rubyid_langs'>langs</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='ivar'>@result</span>
|
983
|
-
<span class='kw'>end</span>
|
984
494
|
<span class='kw'>end</span></pre>
|
985
495
|
</td>
|
986
496
|
</tr>
|
@@ -990,742 +500,10 @@ Brauser::Browser.new.is(:msie).v(">= 7").on?(:windows)
|
|
990
500
|
</div>
|
991
501
|
|
992
502
|
|
993
|
-
<div id="instance_method_details" class="method_details_list">
|
994
|
-
<h2>Instance Method Details</h2>
|
995
|
-
|
996
|
-
|
997
|
-
<div class="method_details first">
|
998
|
-
<h3 class="signature first" id="accepts-instance_method">
|
999
|
-
|
1000
|
-
- (<tt><span class='object_link'><a href="" title="Brauser::Query (class)">Query</a></span></tt>) <strong>accepts</strong>(langs = [])
|
1001
|
-
|
1002
|
-
|
1003
|
-
|
1004
|
-
|
1005
|
-
|
1006
|
-
</h3><div class="docstring">
|
1007
|
-
<div class="discussion">
|
1008
|
-
<p>Check if the browser accepts the specified languages.</p>
|
1009
|
-
|
1010
|
-
|
1011
|
-
</div>
|
1012
|
-
</div>
|
1013
|
-
<div class="tags">
|
1014
|
-
<p class="tag_title">Parameters:</p>
|
1015
|
-
<ul class="param">
|
1016
|
-
|
1017
|
-
<li>
|
1018
|
-
|
1019
|
-
<span class='name'>langs</span>
|
1020
|
-
|
1021
|
-
|
1022
|
-
<span class='type'>(<tt>String|Array</tt>)</span>
|
1023
|
-
|
1024
|
-
|
1025
|
-
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
1026
|
-
|
1027
|
-
|
1028
|
-
—
|
1029
|
-
<div class='inline'><p>A list of languages to match against.</p>
|
1030
|
-
</div>
|
1031
|
-
|
1032
|
-
</li>
|
1033
|
-
|
1034
|
-
</ul>
|
1035
|
-
|
1036
|
-
<p class="tag_title">Returns:</p>
|
1037
|
-
<ul class="return">
|
1038
|
-
|
1039
|
-
<li>
|
1040
|
-
|
1041
|
-
|
1042
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="Brauser::Query (class)">Query</a></span></tt>)</span>
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1046
|
-
—
|
1047
|
-
<div class='inline'><p>The query itself.</p>
|
1048
|
-
</div>
|
1049
|
-
|
1050
|
-
</li>
|
1051
|
-
|
1052
|
-
</ul>
|
1053
|
-
|
1054
|
-
</div><table class="source_code">
|
1055
|
-
<tr>
|
1056
|
-
<td>
|
1057
|
-
<pre class="lines">
|
1058
|
-
|
1059
|
-
|
1060
|
-
105
|
1061
|
-
106
|
1062
|
-
107
|
1063
|
-
108</pre>
|
1064
|
-
</td>
|
1065
|
-
<td>
|
1066
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line 105</span>
|
1067
|
-
|
1068
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_accepts'>accepts</span><span class='lparen'>(</span><span class='id identifier rubyid_langs'>langs</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1069
|
-
<span class='ivar'>@result</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_accepts?'>accepts?</span><span class='lparen'>(</span><span class='id identifier rubyid_langs'>langs</span><span class='rparen'>)</span>
|
1070
|
-
<span class='kw'>self</span>
|
1071
|
-
<span class='kw'>end</span></pre>
|
1072
|
-
</td>
|
1073
|
-
</tr>
|
1074
|
-
</table>
|
1075
|
-
</div>
|
1076
|
-
|
1077
|
-
<div class="method_details ">
|
1078
|
-
<h3 class="signature " id="accepts?-instance_method">
|
1079
|
-
|
1080
|
-
- (<tt>Boolean</tt>) <strong>accepts?</strong>(langs = [])
|
1081
|
-
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
</h3><div class="docstring">
|
1087
|
-
<div class="discussion">
|
1088
|
-
<p>Check if the browser accepts the specified languages.</p>
|
1089
|
-
|
1090
|
-
<p>This version returns a boolean and it is equal to append a call to <span class='object_link'><a href="#result-instance_method" title="Brauser::Query#result (method)">#result</a></span> to the method <span class='object_link'><a href="#accepts-instance_method" title="Brauser::Query#accepts (method)">#accepts</a></span>.</p>
|
1091
|
-
|
1092
|
-
|
1093
|
-
</div>
|
1094
|
-
</div>
|
1095
|
-
<div class="tags">
|
1096
|
-
<p class="tag_title">Parameters:</p>
|
1097
|
-
<ul class="param">
|
1098
|
-
|
1099
|
-
<li>
|
1100
|
-
|
1101
|
-
<span class='name'>langs</span>
|
1102
|
-
|
1103
|
-
|
1104
|
-
<span class='type'>(<tt>String|Array</tt>)</span>
|
1105
|
-
|
1106
|
-
|
1107
|
-
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
1108
|
-
|
1109
|
-
|
1110
|
-
—
|
1111
|
-
<div class='inline'><p>A list of languages to match against.</p>
|
1112
|
-
</div>
|
1113
|
-
|
1114
|
-
</li>
|
1115
|
-
|
1116
|
-
</ul>
|
1117
|
-
|
1118
|
-
<p class="tag_title">Returns:</p>
|
1119
|
-
<ul class="return">
|
1120
|
-
|
1121
|
-
<li>
|
1122
|
-
|
1123
|
-
|
1124
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
1125
|
-
|
1126
|
-
|
1127
|
-
|
1128
|
-
—
|
1129
|
-
<div class='inline'><p><code>true</code> if current browser matches, <code>false</code> otherwise.</p>
|
1130
|
-
</div>
|
1131
|
-
|
1132
|
-
</li>
|
1133
|
-
|
1134
|
-
</ul>
|
1135
|
-
|
1136
|
-
</div><table class="source_code">
|
1137
|
-
<tr>
|
1138
|
-
<td>
|
1139
|
-
<pre class="lines">
|
1140
|
-
|
1141
|
-
|
1142
|
-
116
|
1143
|
-
117
|
1144
|
-
118</pre>
|
1145
|
-
</td>
|
1146
|
-
<td>
|
1147
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line 116</span>
|
1148
|
-
|
1149
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_accepts?'>accepts?</span><span class='lparen'>(</span><span class='id identifier rubyid_langs'>langs</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1150
|
-
<span class='ivar'>@result</span> <span class='op'>?</span> <span class='ivar'>@target</span><span class='period'>.</span><span class='id identifier rubyid_accepts?'>accepts?</span><span class='lparen'>(</span><span class='id identifier rubyid_langs'>langs</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='ivar'>@result</span>
|
1151
|
-
<span class='kw'>end</span></pre>
|
1152
|
-
</td>
|
1153
|
-
</tr>
|
1154
|
-
</table>
|
1155
|
-
</div>
|
1156
|
-
|
1157
|
-
<div class="method_details ">
|
1158
|
-
<h3 class="signature " id="is-instance_method">
|
1159
|
-
|
1160
|
-
- (<tt><span class='object_link'><a href="" title="Brauser::Query (class)">Query</a></span></tt>) <strong>is</strong>(names = [], versions = {}, platforms = [])
|
1161
|
-
|
1162
|
-
|
1163
|
-
|
1164
|
-
|
1165
|
-
|
1166
|
-
</h3><div class="docstring">
|
1167
|
-
<div class="discussion">
|
1168
|
-
<p>Checks if the browser is a specific name and optionally of a specific version and platform.</p>
|
1169
|
-
|
1170
|
-
|
1171
|
-
</div>
|
1172
|
-
</div>
|
1173
|
-
<div class="tags">
|
1174
|
-
<p class="tag_title">Parameters:</p>
|
1175
|
-
<ul class="param">
|
1176
|
-
|
1177
|
-
<li>
|
1178
|
-
|
1179
|
-
<span class='name'>names</span>
|
1180
|
-
|
1181
|
-
|
1182
|
-
<span class='type'>(<tt>Symbol|Array</tt>)</span>
|
1183
|
-
|
1184
|
-
|
1185
|
-
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
1186
|
-
|
1187
|
-
|
1188
|
-
—
|
1189
|
-
<div class='inline'><p>A list of specific names to match. Also, this meta-names are supported: <code>:capable</code> and <code>:tablet</code>.</p>
|
1190
|
-
</div>
|
1191
|
-
|
1192
|
-
</li>
|
1193
|
-
|
1194
|
-
<li>
|
1195
|
-
|
1196
|
-
<span class='name'>versions</span>
|
1197
|
-
|
1198
|
-
|
1199
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
1200
|
-
|
1201
|
-
|
1202
|
-
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1203
|
-
|
1204
|
-
|
1205
|
-
—
|
1206
|
-
<div class='inline'><p>An hash with specific version to match against. Need to be in any form that <span class='object_link'><a href="#v-instance_method" title="Brauser::Query#v (method)">#v</a></span> understands.</p>
|
1207
|
-
</div>
|
1208
|
-
|
1209
|
-
</li>
|
1210
|
-
|
1211
|
-
<li>
|
1212
|
-
|
1213
|
-
<span class='name'>platforms</span>
|
1214
|
-
|
1215
|
-
|
1216
|
-
<span class='type'>(<tt>Symbol|Array</tt>)</span>
|
1217
|
-
|
1218
|
-
|
1219
|
-
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
1220
|
-
|
1221
|
-
|
1222
|
-
—
|
1223
|
-
<div class='inline'><p>A list of specific platform to match. Valid values are all those possible for the platform attribute.</p>
|
1224
|
-
</div>
|
1225
|
-
|
1226
|
-
</li>
|
1227
|
-
|
1228
|
-
</ul>
|
1229
|
-
|
1230
|
-
<p class="tag_title">Returns:</p>
|
1231
|
-
<ul class="return">
|
1232
|
-
|
1233
|
-
<li>
|
1234
|
-
|
1235
|
-
|
1236
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="Brauser::Query (class)">Query</a></span></tt>)</span>
|
1237
|
-
|
1238
|
-
|
1239
|
-
|
1240
|
-
—
|
1241
|
-
<div class='inline'><p>The query itself.</p>
|
1242
|
-
</div>
|
1243
|
-
|
1244
|
-
</li>
|
1245
|
-
|
1246
|
-
</ul>
|
1247
|
-
|
1248
|
-
<p class="tag_title">See Also:</p>
|
1249
|
-
<ul class="see">
|
1250
|
-
|
1251
|
-
<li>#version?</li>
|
1252
|
-
|
1253
|
-
<li><span class='object_link'><a href="#on%3F-instance_method" title="Brauser::Query#on? (method)">#on?</a></span></li>
|
1254
|
-
|
1255
|
-
</ul>
|
1256
|
-
|
1257
|
-
</div><table class="source_code">
|
1258
|
-
<tr>
|
1259
|
-
<td>
|
1260
|
-
<pre class="lines">
|
1261
|
-
|
1262
|
-
|
1263
|
-
43
|
1264
|
-
44
|
1265
|
-
45
|
1266
|
-
46</pre>
|
1267
|
-
</td>
|
1268
|
-
<td>
|
1269
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line 43</span>
|
1270
|
-
|
1271
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_is'>is</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1272
|
-
<span class='ivar'>@result</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_is?'>is?</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span><span class='rparen'>)</span>
|
1273
|
-
<span class='kw'>self</span>
|
1274
|
-
<span class='kw'>end</span></pre>
|
1275
|
-
</td>
|
1276
|
-
</tr>
|
1277
|
-
</table>
|
1278
|
-
</div>
|
1279
|
-
|
1280
|
-
<div class="method_details ">
|
1281
|
-
<h3 class="signature " id="is?-instance_method">
|
1282
|
-
|
1283
|
-
- (<tt>Boolean</tt>) <strong>is?</strong>(names = [], versions = {}, platforms = [])
|
1284
|
-
|
1285
|
-
|
1286
|
-
|
1287
|
-
|
1288
|
-
|
1289
|
-
</h3><div class="docstring">
|
1290
|
-
<div class="discussion">
|
1291
|
-
<p>Checks if the browser is a specific name and optionally of a specific version and platform.</p>
|
1292
|
-
|
1293
|
-
<p>This version returns a boolean and it is equal to append a call to <span class='object_link'><a href="#result-instance_method" title="Brauser::Query#result (method)">#result</a></span> to the method <span class='object_link'><a href="#is-instance_method" title="Brauser::Query#is (method)">#is</a></span>.</p>
|
1294
|
-
|
1295
|
-
|
1296
|
-
</div>
|
1297
|
-
</div>
|
1298
|
-
<div class="tags">
|
1299
|
-
<p class="tag_title">Parameters:</p>
|
1300
|
-
<ul class="param">
|
1301
|
-
|
1302
|
-
<li>
|
1303
|
-
|
1304
|
-
<span class='name'>names</span>
|
1305
|
-
|
1306
|
-
|
1307
|
-
<span class='type'>(<tt>Symbol|Array</tt>)</span>
|
1308
|
-
|
1309
|
-
|
1310
|
-
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
1311
|
-
|
1312
|
-
|
1313
|
-
—
|
1314
|
-
<div class='inline'><p>A list of specific names to match. Also, this meta-names are supported: <code>:capable</code> and <code>:tablet</code>.</p>
|
1315
|
-
</div>
|
1316
|
-
|
1317
|
-
</li>
|
1318
|
-
|
1319
|
-
<li>
|
1320
|
-
|
1321
|
-
<span class='name'>versions</span>
|
1322
|
-
|
1323
|
-
|
1324
|
-
<span class='type'>(<tt>Hash</tt>)</span>
|
1325
|
-
|
1326
|
-
|
1327
|
-
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1328
|
-
|
1329
|
-
|
1330
|
-
—
|
1331
|
-
<div class='inline'><p>An hash with specific version to match against. Need to be in any form that <span class='object_link'><a href="#v-instance_method" title="Brauser::Query#v (method)">#v</a></span> understands.</p>
|
1332
|
-
</div>
|
1333
|
-
|
1334
|
-
</li>
|
1335
|
-
|
1336
|
-
<li>
|
1337
|
-
|
1338
|
-
<span class='name'>platforms</span>
|
1339
|
-
|
1340
|
-
|
1341
|
-
<span class='type'>(<tt>Symbol|Array</tt>)</span>
|
1342
|
-
|
1343
|
-
|
1344
|
-
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
1345
|
-
|
1346
|
-
|
1347
|
-
—
|
1348
|
-
<div class='inline'><p>A list of specific platform to match. Valid values are all those possible for the platform attribute.</p>
|
1349
|
-
</div>
|
1350
|
-
|
1351
|
-
</li>
|
1352
|
-
|
1353
|
-
</ul>
|
1354
|
-
|
1355
|
-
<p class="tag_title">Returns:</p>
|
1356
|
-
<ul class="return">
|
1357
|
-
|
1358
|
-
<li>
|
1359
|
-
|
1360
|
-
|
1361
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
1362
|
-
|
1363
|
-
|
1364
|
-
|
1365
|
-
—
|
1366
|
-
<div class='inline'><p><code>true</code> if current browser matches, <code>false</code> otherwise.</p>
|
1367
|
-
</div>
|
1368
|
-
|
1369
|
-
</li>
|
1370
|
-
|
1371
|
-
</ul>
|
1372
|
-
|
1373
|
-
<p class="tag_title">See Also:</p>
|
1374
|
-
<ul class="see">
|
1375
|
-
|
1376
|
-
<li>#version?</li>
|
1377
|
-
|
1378
|
-
<li><span class='object_link'><a href="#on%3F-instance_method" title="Brauser::Query#on? (method)">#on?</a></span></li>
|
1379
|
-
|
1380
|
-
</ul>
|
1381
|
-
|
1382
|
-
</div><table class="source_code">
|
1383
|
-
<tr>
|
1384
|
-
<td>
|
1385
|
-
<pre class="lines">
|
1386
|
-
|
1387
|
-
|
1388
|
-
59
|
1389
|
-
60
|
1390
|
-
61</pre>
|
1391
|
-
</td>
|
1392
|
-
<td>
|
1393
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line 59</span>
|
1394
|
-
|
1395
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_is?'>is?</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1396
|
-
<span class='ivar'>@result</span> <span class='op'>?</span> <span class='ivar'>@target</span><span class='period'>.</span><span class='id identifier rubyid_is?'>is?</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='ivar'>@result</span>
|
1397
|
-
<span class='kw'>end</span></pre>
|
1398
|
-
</td>
|
1399
|
-
</tr>
|
1400
|
-
</table>
|
1401
|
-
</div>
|
1402
|
-
|
1403
|
-
<div class="method_details ">
|
1404
|
-
<h3 class="signature " id="on-instance_method">
|
1405
|
-
|
1406
|
-
- (<tt><span class='object_link'><a href="" title="Brauser::Query (class)">Query</a></span></tt>) <strong>on</strong>(platforms = [])
|
1407
|
-
|
1408
|
-
|
1409
|
-
|
1410
|
-
|
1411
|
-
|
1412
|
-
</h3><div class="docstring">
|
1413
|
-
<div class="discussion">
|
1414
|
-
<p>Check if the browser is on a specific platform.</p>
|
1415
|
-
|
1416
|
-
|
1417
|
-
</div>
|
1418
|
-
</div>
|
1419
|
-
<div class="tags">
|
1420
|
-
<p class="tag_title">Parameters:</p>
|
1421
|
-
<ul class="param">
|
1422
|
-
|
1423
|
-
<li>
|
1424
|
-
|
1425
|
-
<span class='name'>platforms</span>
|
1426
|
-
|
1427
|
-
|
1428
|
-
<span class='type'>(<tt>Symbol|Array</tt>)</span>
|
1429
|
-
|
1430
|
-
|
1431
|
-
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
1432
|
-
|
1433
|
-
|
1434
|
-
—
|
1435
|
-
<div class='inline'><p>A list of specific platform to match.</p>
|
1436
|
-
</div>
|
1437
|
-
|
1438
|
-
</li>
|
1439
|
-
|
1440
|
-
</ul>
|
1441
|
-
|
1442
|
-
<p class="tag_title">Returns:</p>
|
1443
|
-
<ul class="return">
|
1444
|
-
|
1445
|
-
<li>
|
1446
|
-
|
1447
|
-
|
1448
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="Brauser::Query (class)">Query</a></span></tt>)</span>
|
1449
|
-
|
1450
|
-
|
1451
|
-
|
1452
|
-
—
|
1453
|
-
<div class='inline'><p>The query itself.</p>
|
1454
|
-
</div>
|
1455
|
-
|
1456
|
-
</li>
|
1457
|
-
|
1458
|
-
</ul>
|
1459
|
-
|
1460
|
-
</div><table class="source_code">
|
1461
|
-
<tr>
|
1462
|
-
<td>
|
1463
|
-
<pre class="lines">
|
1464
|
-
|
1465
|
-
|
1466
|
-
86
|
1467
|
-
87
|
1468
|
-
88
|
1469
|
-
89</pre>
|
1470
|
-
</td>
|
1471
|
-
<td>
|
1472
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line 86</span>
|
1473
|
-
|
1474
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_on'>on</span><span class='lparen'>(</span><span class='id identifier rubyid_platforms'>platforms</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1475
|
-
<span class='ivar'>@result</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_on?'>on?</span><span class='lparen'>(</span><span class='id identifier rubyid_platforms'>platforms</span><span class='rparen'>)</span>
|
1476
|
-
<span class='kw'>self</span>
|
1477
|
-
<span class='kw'>end</span></pre>
|
1478
|
-
</td>
|
1479
|
-
</tr>
|
1480
|
-
</table>
|
1481
|
-
</div>
|
1482
|
-
|
1483
|
-
<div class="method_details ">
|
1484
|
-
<h3 class="signature " id="on?-instance_method">
|
1485
|
-
|
1486
|
-
- (<tt>Boolean</tt>) <strong>on?</strong>(platforms = [])
|
1487
|
-
|
1488
|
-
|
1489
|
-
|
1490
|
-
|
1491
|
-
|
1492
|
-
</h3><div class="docstring">
|
1493
|
-
<div class="discussion">
|
1494
|
-
<p>Check if the browser is on a specific platform.</p>
|
1495
|
-
|
1496
|
-
<p>This version returns a boolean and it is equal to append a call to <span class='object_link'><a href="#result-instance_method" title="Brauser::Query#result (method)">#result</a></span> to the method <span class='object_link'><a href="#on-instance_method" title="Brauser::Query#on (method)">#on</a></span>.</p>
|
1497
|
-
|
1498
|
-
|
1499
|
-
</div>
|
1500
|
-
</div>
|
1501
|
-
<div class="tags">
|
1502
|
-
<p class="tag_title">Parameters:</p>
|
1503
|
-
<ul class="param">
|
1504
|
-
|
1505
|
-
<li>
|
1506
|
-
|
1507
|
-
<span class='name'>platforms</span>
|
1508
|
-
|
1509
|
-
|
1510
|
-
<span class='type'>(<tt>Symbol|Array</tt>)</span>
|
1511
|
-
|
1512
|
-
|
1513
|
-
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
1514
|
-
|
1515
|
-
|
1516
|
-
—
|
1517
|
-
<div class='inline'><p>A list of specific platform to match.</p>
|
1518
|
-
</div>
|
1519
|
-
|
1520
|
-
</li>
|
1521
|
-
|
1522
|
-
</ul>
|
1523
|
-
|
1524
|
-
<p class="tag_title">Returns:</p>
|
1525
|
-
<ul class="return">
|
1526
|
-
|
1527
|
-
<li>
|
1528
|
-
|
1529
|
-
|
1530
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
1531
|
-
|
1532
|
-
|
1533
|
-
|
1534
|
-
—
|
1535
|
-
<div class='inline'><p><code>true</code> if current browser matches, <code>false</code> otherwise.</p>
|
1536
|
-
</div>
|
1537
|
-
|
1538
|
-
</li>
|
1539
|
-
|
1540
|
-
</ul>
|
1541
|
-
|
1542
|
-
</div><table class="source_code">
|
1543
|
-
<tr>
|
1544
|
-
<td>
|
1545
|
-
<pre class="lines">
|
1546
|
-
|
1547
|
-
|
1548
|
-
97
|
1549
|
-
98
|
1550
|
-
99</pre>
|
1551
|
-
</td>
|
1552
|
-
<td>
|
1553
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line 97</span>
|
1554
|
-
|
1555
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_on?'>on?</span><span class='lparen'>(</span><span class='id identifier rubyid_platforms'>platforms</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span><span class='rparen'>)</span>
|
1556
|
-
<span class='ivar'>@result</span> <span class='op'>?</span> <span class='ivar'>@target</span><span class='period'>.</span><span class='id identifier rubyid_on?'>on?</span><span class='lparen'>(</span><span class='id identifier rubyid_platforms'>platforms</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='ivar'>@result</span>
|
1557
|
-
<span class='kw'>end</span></pre>
|
1558
|
-
</td>
|
1559
|
-
</tr>
|
1560
|
-
</table>
|
1561
|
-
</div>
|
1562
|
-
|
1563
|
-
<div class="method_details ">
|
1564
|
-
<h3 class="signature " id="v-instance_method">
|
1565
|
-
|
1566
|
-
- (<tt><span class='object_link'><a href="" title="Brauser::Query (class)">Query</a></span></tt>) <strong>v</strong>(versions = {})
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
</h3><div class="docstring">
|
1573
|
-
<div class="discussion">
|
1574
|
-
<p>Checks if the browser is a specific version.</p>
|
1575
|
-
|
1576
|
-
|
1577
|
-
</div>
|
1578
|
-
</div>
|
1579
|
-
<div class="tags">
|
1580
|
-
<p class="tag_title">Parameters:</p>
|
1581
|
-
<ul class="param">
|
1582
|
-
|
1583
|
-
<li>
|
1584
|
-
|
1585
|
-
<span class='name'>versions</span>
|
1586
|
-
|
1587
|
-
|
1588
|
-
<span class='type'>(<tt>String|Hash</tt>)</span>
|
1589
|
-
|
1590
|
-
|
1591
|
-
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1592
|
-
|
1593
|
-
|
1594
|
-
—
|
1595
|
-
<div class='inline'><p>A string in the form <code>operator version && ...</code> (example: <code>>= 7 && < 4</code>) or an hash with specific version to match against, in form <code>{:operator => version}</code>, where operator is one of <code>:lt, :lte, :eq, :gt, :gte</code>.</p>
|
1596
|
-
</div>
|
1597
|
-
|
1598
|
-
</li>
|
1599
|
-
|
1600
|
-
</ul>
|
1601
|
-
|
1602
|
-
<p class="tag_title">Returns:</p>
|
1603
|
-
<ul class="return">
|
1604
|
-
|
1605
|
-
<li>
|
1606
|
-
|
1607
|
-
|
1608
|
-
<span class='type'>(<tt><span class='object_link'><a href="" title="Brauser::Query (class)">Query</a></span></tt>)</span>
|
1609
|
-
|
1610
|
-
|
1611
|
-
|
1612
|
-
—
|
1613
|
-
<div class='inline'><p>The query itself.</p>
|
1614
|
-
</div>
|
1615
|
-
|
1616
|
-
</li>
|
1617
|
-
|
1618
|
-
</ul>
|
1619
|
-
|
1620
|
-
</div><table class="source_code">
|
1621
|
-
<tr>
|
1622
|
-
<td>
|
1623
|
-
<pre class="lines">
|
1624
|
-
|
1625
|
-
|
1626
|
-
67
|
1627
|
-
68
|
1628
|
-
69
|
1629
|
-
70</pre>
|
1630
|
-
</td>
|
1631
|
-
<td>
|
1632
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line 67</span>
|
1633
|
-
|
1634
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_v'>v</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
1635
|
-
<span class='ivar'>@result</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_v?'>v?</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span><span class='rparen'>)</span>
|
1636
|
-
<span class='kw'>self</span>
|
1637
|
-
<span class='kw'>end</span></pre>
|
1638
|
-
</td>
|
1639
|
-
</tr>
|
1640
|
-
</table>
|
1641
|
-
</div>
|
1642
|
-
|
1643
|
-
<div class="method_details ">
|
1644
|
-
<h3 class="signature " id="v?-instance_method">
|
1645
|
-
|
1646
|
-
- (<tt>Boolean</tt>) <strong>v?</strong>(versions = {})
|
1647
|
-
|
1648
|
-
|
1649
|
-
|
1650
|
-
|
1651
|
-
|
1652
|
-
</h3><div class="docstring">
|
1653
|
-
<div class="discussion">
|
1654
|
-
<p>Checks if the browser is a specific version.</p>
|
1655
|
-
|
1656
|
-
<p>This version returns a boolean and it is equal to append a call to <span class='object_link'><a href="#result-instance_method" title="Brauser::Query#result (method)">#result</a></span> to the method <span class='object_link'><a href="#v-instance_method" title="Brauser::Query#v (method)">#v</a></span>.</p>
|
1657
|
-
|
1658
|
-
|
1659
|
-
</div>
|
1660
|
-
</div>
|
1661
|
-
<div class="tags">
|
1662
|
-
<p class="tag_title">Parameters:</p>
|
1663
|
-
<ul class="param">
|
1664
|
-
|
1665
|
-
<li>
|
1666
|
-
|
1667
|
-
<span class='name'>versions</span>
|
1668
|
-
|
1669
|
-
|
1670
|
-
<span class='type'>(<tt>String|Hash</tt>)</span>
|
1671
|
-
|
1672
|
-
|
1673
|
-
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
1674
|
-
|
1675
|
-
|
1676
|
-
—
|
1677
|
-
<div class='inline'><p>A string in the form <code>operator version && ...</code> (example: <code>>= 7 && < 4</code>) or an hash with specific version to match against, in form <code>{:operator => version}</code>, where operator is one of <code>:lt, :lte, :eq, :gt, :gte</code>.</p>
|
1678
|
-
</div>
|
1679
|
-
|
1680
|
-
</li>
|
1681
|
-
|
1682
|
-
</ul>
|
1683
|
-
|
1684
|
-
<p class="tag_title">Returns:</p>
|
1685
|
-
<ul class="return">
|
1686
|
-
|
1687
|
-
<li>
|
1688
|
-
|
1689
|
-
|
1690
|
-
<span class='type'>(<tt>Boolean</tt>)</span>
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
—
|
1695
|
-
<div class='inline'><p><code>true</code> if current browser matches, <code>false</code> otherwise.</p>
|
1696
|
-
</div>
|
1697
|
-
|
1698
|
-
</li>
|
1699
|
-
|
1700
|
-
</ul>
|
1701
|
-
|
1702
|
-
</div><table class="source_code">
|
1703
|
-
<tr>
|
1704
|
-
<td>
|
1705
|
-
<pre class="lines">
|
1706
|
-
|
1707
|
-
|
1708
|
-
78
|
1709
|
-
79
|
1710
|
-
80</pre>
|
1711
|
-
</td>
|
1712
|
-
<td>
|
1713
|
-
<pre class="code"><span class="info file"># File 'lib/brauser/query.rb', line 78</span>
|
1714
|
-
|
1715
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_v?'>v?</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
1716
|
-
<span class='ivar'>@result</span> <span class='op'>?</span> <span class='ivar'>@target</span><span class='period'>.</span><span class='id identifier rubyid_v?'>v?</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span><span class='rparen'>)</span> <span class='op'>:</span> <span class='ivar'>@result</span>
|
1717
|
-
<span class='kw'>end</span></pre>
|
1718
|
-
</td>
|
1719
|
-
</tr>
|
1720
|
-
</table>
|
1721
|
-
</div>
|
1722
|
-
|
1723
|
-
</div>
|
1724
|
-
|
1725
503
|
</div>
|
1726
504
|
|
1727
505
|
<div id="footer">
|
1728
|
-
Generated on
|
506
|
+
Generated on Sun May 19 12:02:57 2013 by
|
1729
507
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1730
508
|
0.8.6.1 (ruby-1.9.3).
|
1731
509
|
</div>
|