brauser 1.0.7 → 2.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/.travis.yml +1 -1
- data/Gemfile +1 -1
- data/README.md +6 -3
- data/Rakefile +1 -1
- data/brauser.gemspec +10 -8
- data/doc/Brauser.html +4 -4
- data/doc/Brauser/Browser.html +1722 -3546
- data/doc/Brauser/BrowserMethods.html +125 -0
- data/doc/Brauser/BrowserMethods/Attributes.html +484 -0
- data/doc/Brauser/BrowserMethods/General.html +134 -0
- data/doc/Brauser/BrowserMethods/General/ClassMethods.html +529 -0
- data/doc/Brauser/BrowserMethods/Parsing.html +350 -0
- data/doc/Brauser/BrowserMethods/PartialQuerying.html +629 -0
- data/doc/Brauser/BrowserMethods/Querying.html +583 -0
- data/doc/Brauser/BrowserMethods/Register.html +134 -0
- data/doc/Brauser/BrowserMethods/Register/ClassMethods.html +1081 -0
- data/doc/Brauser/Hooks.html +3 -3
- data/doc/Brauser/Hooks/RubyOnRails.html +3 -3
- data/doc/Brauser/Query.html +470 -52
- data/doc/Brauser/Version.html +5 -5
- data/doc/_index.html +102 -4
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +11 -8
- data/doc/frames.html +1 -1
- data/doc/index.html +11 -8
- data/doc/method_list.html +61 -61
- data/doc/top-level-namespace.html +3 -3
- data/lib/brauser.rb +1 -1
- data/lib/brauser/browser.rb +725 -674
- data/lib/brauser/hooks.rb +1 -1
- data/lib/brauser/query.rb +6 -4
- data/lib/brauser/version.rb +3 -3
- data/spec/brauser/browser_spec.rb +15 -38
- data/spec/brauser/hooks_spec.rb +1 -1
- data/spec/brauser/query_spec.rb +1 -1
- data/spec/brauser_spec.rb +1 -1
- data/spec/coverage_helper.rb +1 -1
- data/spec/frameworks_helper.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- metadata +25 -22
@@ -0,0 +1,350 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Brauser::BrowserMethods::Parsing
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.3
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (P)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Brauser.html" title="Brauser (module)">Brauser</a></span></span> » <span class='title'><span class='object_link'><a href="../BrowserMethods.html" title="Brauser::BrowserMethods (module)">BrowserMethods</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Parsing</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: Brauser::BrowserMethods::Parsing
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
<dt class="r1">Included in:</dt>
|
81
|
+
<dd class="r1"><span class='object_link'><a href="../Browser.html" title="Brauser::Browser (class)">Brauser::Browser</a></span></dd>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
<dt class="r2 last">Defined in:</dt>
|
86
|
+
<dd class="r2 last">lib/brauser/browser.rb</dd>
|
87
|
+
|
88
|
+
</dl>
|
89
|
+
<div class="clear"></div>
|
90
|
+
|
91
|
+
<h2>Overview</h2><div class="docstring">
|
92
|
+
<div class="discussion">
|
93
|
+
<p>Methods to parse the user agent.</p>
|
94
|
+
|
95
|
+
|
96
|
+
</div>
|
97
|
+
</div>
|
98
|
+
<div class="tags">
|
99
|
+
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<h2>
|
110
|
+
Instance Method Summary
|
111
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
112
|
+
</h2>
|
113
|
+
|
114
|
+
<ul class="summary">
|
115
|
+
|
116
|
+
<li class="public ">
|
117
|
+
<span class="summary_signature">
|
118
|
+
|
119
|
+
<a href="#parse_accept_language-instance_method" title="#parse_accept_language (instance method)">- (Array) <strong>parse_accept_language</strong>(accept_language = nil) </a>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
</span>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<span class="summary_desc"><div class='inline'><p>Parses the Accept-Language header.</p>
|
134
|
+
</div></span>
|
135
|
+
|
136
|
+
</li>
|
137
|
+
|
138
|
+
|
139
|
+
<li class="public ">
|
140
|
+
<span class="summary_signature">
|
141
|
+
|
142
|
+
<a href="#parse_agent-instance_method" title="#parse_agent (instance method)">- (Boolean) <strong>parse_agent</strong>(agent = nil) </a>
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
</span>
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
<span class="summary_desc"><div class='inline'><p>Parses the User-Agent header.</p>
|
157
|
+
</div></span>
|
158
|
+
|
159
|
+
</li>
|
160
|
+
|
161
|
+
|
162
|
+
</ul>
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
<div id="instance_method_details" class="method_details_list">
|
168
|
+
<h2>Instance Method Details</h2>
|
169
|
+
|
170
|
+
|
171
|
+
<div class="method_details first">
|
172
|
+
<h3 class="signature first" id="parse_accept_language-instance_method">
|
173
|
+
|
174
|
+
- (<tt>Array</tt>) <strong>parse_accept_language</strong>(accept_language = nil)
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
</h3><div class="docstring">
|
181
|
+
<div class="discussion">
|
182
|
+
<p>Parses the Accept-Language header.</p>
|
183
|
+
|
184
|
+
|
185
|
+
</div>
|
186
|
+
</div>
|
187
|
+
<div class="tags">
|
188
|
+
<p class="tag_title">Parameters:</p>
|
189
|
+
<ul class="param">
|
190
|
+
|
191
|
+
<li>
|
192
|
+
|
193
|
+
<span class='name'>accept_language</span>
|
194
|
+
|
195
|
+
|
196
|
+
<span class='type'>(<tt>String</tt>)</span>
|
197
|
+
|
198
|
+
|
199
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
200
|
+
|
201
|
+
|
202
|
+
—
|
203
|
+
<div class='inline'><p>The Accept-Language header.</p>
|
204
|
+
</div>
|
205
|
+
|
206
|
+
</li>
|
207
|
+
|
208
|
+
</ul>
|
209
|
+
|
210
|
+
<p class="tag_title">Returns:</p>
|
211
|
+
<ul class="return">
|
212
|
+
|
213
|
+
<li>
|
214
|
+
|
215
|
+
|
216
|
+
<span class='type'>(<tt>Array</tt>)</span>
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
—
|
221
|
+
<div class='inline'><p>The list of accepted languages.</p>
|
222
|
+
</div>
|
223
|
+
|
224
|
+
</li>
|
225
|
+
|
226
|
+
</ul>
|
227
|
+
|
228
|
+
</div><table class="source_code">
|
229
|
+
<tr>
|
230
|
+
<td>
|
231
|
+
<pre class="lines">
|
232
|
+
|
233
|
+
|
234
|
+
492
|
235
|
+
493
|
236
|
+
494</pre>
|
237
|
+
</td>
|
238
|
+
<td>
|
239
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 492</span>
|
240
|
+
|
241
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_parse_accept_language'>parse_accept_language</span><span class='lparen'>(</span><span class='id identifier rubyid_accept_language'>accept_language</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
242
|
+
<span class='id identifier rubyid_accept_language'>accept_language</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>;q=[\d.]+</span><span class='regexp_end'>/</span></span><span class='comma'>,</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_split'>split</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>,</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_downcase'>downcase</span><span class='period'>.</span><span class='id identifier rubyid_strip'>strip</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_select'>select</span><span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span> <span class='rbrace'>}</span>
|
243
|
+
<span class='kw'>end</span></pre>
|
244
|
+
</td>
|
245
|
+
</tr>
|
246
|
+
</table>
|
247
|
+
</div>
|
248
|
+
|
249
|
+
<div class="method_details ">
|
250
|
+
<h3 class="signature " id="parse_agent-instance_method">
|
251
|
+
|
252
|
+
- (<tt>Boolean</tt>) <strong>parse_agent</strong>(agent = nil)
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
</h3><div class="docstring">
|
259
|
+
<div class="discussion">
|
260
|
+
<p>Parses the User-Agent header.</p>
|
261
|
+
|
262
|
+
|
263
|
+
</div>
|
264
|
+
</div>
|
265
|
+
<div class="tags">
|
266
|
+
<p class="tag_title">Parameters:</p>
|
267
|
+
<ul class="param">
|
268
|
+
|
269
|
+
<li>
|
270
|
+
|
271
|
+
<span class='name'>agent</span>
|
272
|
+
|
273
|
+
|
274
|
+
<span class='type'>(<tt>String</tt>)</span>
|
275
|
+
|
276
|
+
|
277
|
+
<em class="default">(defaults to: <tt>nil</tt>)</em>
|
278
|
+
|
279
|
+
|
280
|
+
—
|
281
|
+
<div class='inline'><p>The User-Agent header.</p>
|
282
|
+
</div>
|
283
|
+
|
284
|
+
</li>
|
285
|
+
|
286
|
+
</ul>
|
287
|
+
|
288
|
+
<p class="tag_title">Returns:</p>
|
289
|
+
<ul class="return">
|
290
|
+
|
291
|
+
<li>
|
292
|
+
|
293
|
+
|
294
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
—
|
299
|
+
<div class='inline'><p><code>true</code> if the browser was detected, <code>false</code> otherwise.</p>
|
300
|
+
</div>
|
301
|
+
|
302
|
+
</li>
|
303
|
+
|
304
|
+
</ul>
|
305
|
+
|
306
|
+
</div><table class="source_code">
|
307
|
+
<tr>
|
308
|
+
<td>
|
309
|
+
<pre class="lines">
|
310
|
+
|
311
|
+
|
312
|
+
478
|
313
|
+
479
|
314
|
+
480
|
315
|
+
481
|
316
|
+
482
|
317
|
+
483
|
318
|
+
484
|
319
|
+
485
|
320
|
+
486</pre>
|
321
|
+
</td>
|
322
|
+
<td>
|
323
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 478</span>
|
324
|
+
|
325
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_parse_agent'>parse_agent</span><span class='lparen'>(</span><span class='id identifier rubyid_agent'>agent</span> <span class='op'>=</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
326
|
+
<span class='id identifier rubyid_agent'>agent</span> <span class='op'>=</span> <span class='id identifier rubyid_agent'>agent</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span>
|
327
|
+
|
328
|
+
<span class='ivar'>@name</span><span class='comma'>,</span> <span class='id identifier rubyid_version'>version</span> <span class='op'>=</span> <span class='id identifier rubyid_match_name_and_version'>match_name_and_version</span><span class='lparen'>(</span><span class='id identifier rubyid_agent'>agent</span><span class='rparen'>)</span>
|
329
|
+
<span class='ivar'>@version</span> <span class='op'>=</span> <span class='id identifier rubyid_adjust_version'>adjust_version</span><span class='lparen'>(</span><span class='ivar'>@version</span><span class='rparen'>)</span>
|
330
|
+
<span class='ivar'>@platform</span> <span class='op'>=</span> <span class='id identifier rubyid_match_platform'>match_platform</span><span class='lparen'>(</span><span class='id identifier rubyid_agent'>agent</span><span class='rparen'>)</span>
|
331
|
+
|
332
|
+
<span class='lparen'>(</span><span class='ivar'>@name</span> <span class='op'>!=</span> <span class='symbol'>:unknown</span><span class='rparen'>)</span> <span class='op'>?</span> <span class='kw'>true</span> <span class='op'>:</span> <span class='kw'>false</span>
|
333
|
+
<span class='kw'>end</span></pre>
|
334
|
+
</td>
|
335
|
+
</tr>
|
336
|
+
</table>
|
337
|
+
</div>
|
338
|
+
|
339
|
+
</div>
|
340
|
+
|
341
|
+
</div>
|
342
|
+
|
343
|
+
<div id="footer">
|
344
|
+
Generated on Sat Feb 2 17:47:19 2013 by
|
345
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
346
|
+
0.8.3 (ruby-1.9.3).
|
347
|
+
</div>
|
348
|
+
|
349
|
+
</body>
|
350
|
+
</html>
|
@@ -0,0 +1,629 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
|
+
<title>
|
7
|
+
Module: Brauser::BrowserMethods::PartialQuerying
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.3
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../../';
|
20
|
+
framesUrl = "../../frames.html#!" + escape(window.location.href);
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../../_index.html">Index (P)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../../Brauser.html" title="Brauser (module)">Brauser</a></span></span> » <span class='title'><span class='object_link'><a href="../BrowserMethods.html" title="Brauser::BrowserMethods (module)">BrowserMethods</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">PartialQuerying</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Module: Brauser::BrowserMethods::PartialQuerying
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
|
80
|
+
<dt class="r1">Included in:</dt>
|
81
|
+
<dd class="r1"><span class='object_link'><a href="../Browser.html" title="Brauser::Browser (class)">Brauser::Browser</a></span></dd>
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
<dt class="r2 last">Defined in:</dt>
|
86
|
+
<dd class="r2 last">lib/brauser/browser.rb</dd>
|
87
|
+
|
88
|
+
</dl>
|
89
|
+
<div class="clear"></div>
|
90
|
+
|
91
|
+
<h2>Overview</h2><div class="docstring">
|
92
|
+
<div class="discussion">
|
93
|
+
<p>Methods to query with chaining.</p>
|
94
|
+
|
95
|
+
|
96
|
+
</div>
|
97
|
+
</div>
|
98
|
+
<div class="tags">
|
99
|
+
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
<h2>
|
110
|
+
Instance Method Summary
|
111
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
112
|
+
</h2>
|
113
|
+
|
114
|
+
<ul class="summary">
|
115
|
+
|
116
|
+
<li class="public ">
|
117
|
+
<span class="summary_signature">
|
118
|
+
|
119
|
+
<a href="#accepts-instance_method" title="#accepts (instance method)">- (Query) <strong>accepts</strong>(langs = []) </a>
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
</span>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<span class="summary_desc"><div class='inline'><p>Check if the browser accepts the specified languages.</p>
|
134
|
+
</div></span>
|
135
|
+
|
136
|
+
</li>
|
137
|
+
|
138
|
+
|
139
|
+
<li class="public ">
|
140
|
+
<span class="summary_signature">
|
141
|
+
|
142
|
+
<a href="#is-instance_method" title="#is (instance method)">- (Query) <strong>is</strong>(names = [], versions = {}, platforms = []) </a>
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
</span>
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
<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>
|
157
|
+
</div></span>
|
158
|
+
|
159
|
+
</li>
|
160
|
+
|
161
|
+
|
162
|
+
<li class="public ">
|
163
|
+
<span class="summary_signature">
|
164
|
+
|
165
|
+
<a href="#on-instance_method" title="#on (instance method)">- (Query) <strong>on</strong>(platforms = []) </a>
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
</span>
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
<span class="summary_desc"><div class='inline'><p>Check if the browser is on a specific platform.</p>
|
180
|
+
</div></span>
|
181
|
+
|
182
|
+
</li>
|
183
|
+
|
184
|
+
|
185
|
+
<li class="public ">
|
186
|
+
<span class="summary_signature">
|
187
|
+
|
188
|
+
<a href="#v-instance_method" title="#v (instance method)">- (Query) <strong>v</strong>(versions = {}) </a>
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
</span>
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
<span class="summary_desc"><div class='inline'><p>Checks if the brower is a specific version.</p>
|
203
|
+
</div></span>
|
204
|
+
|
205
|
+
</li>
|
206
|
+
|
207
|
+
|
208
|
+
</ul>
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
<div id="instance_method_details" class="method_details_list">
|
214
|
+
<h2>Instance Method Details</h2>
|
215
|
+
|
216
|
+
|
217
|
+
<div class="method_details first">
|
218
|
+
<h3 class="signature first" id="accepts-instance_method">
|
219
|
+
|
220
|
+
- (<tt><span class='object_link'><a href="../Query.html" title="Brauser::Query (class)">Query</a></span></tt>) <strong>accepts</strong>(langs = [])
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
</h3><div class="docstring">
|
227
|
+
<div class="discussion">
|
228
|
+
<p>Check if the browser accepts the specified languages.</p>
|
229
|
+
|
230
|
+
|
231
|
+
</div>
|
232
|
+
</div>
|
233
|
+
<div class="tags">
|
234
|
+
<p class="tag_title">Parameters:</p>
|
235
|
+
<ul class="param">
|
236
|
+
|
237
|
+
<li>
|
238
|
+
|
239
|
+
<span class='name'>langs</span>
|
240
|
+
|
241
|
+
|
242
|
+
<span class='type'>(<tt>String|Array</tt>)</span>
|
243
|
+
|
244
|
+
|
245
|
+
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
246
|
+
|
247
|
+
|
248
|
+
—
|
249
|
+
<div class='inline'><p>A list of languages to match against.</p>
|
250
|
+
</div>
|
251
|
+
|
252
|
+
</li>
|
253
|
+
|
254
|
+
</ul>
|
255
|
+
|
256
|
+
<p class="tag_title">Returns:</p>
|
257
|
+
<ul class="return">
|
258
|
+
|
259
|
+
<li>
|
260
|
+
|
261
|
+
|
262
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Query.html" title="Brauser::Query (class)">Query</a></span></tt>)</span>
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
—
|
267
|
+
<div class='inline'><p>A query which can evaluated for concatenation or result.</p>
|
268
|
+
</div>
|
269
|
+
|
270
|
+
</li>
|
271
|
+
|
272
|
+
</ul>
|
273
|
+
|
274
|
+
</div><table class="source_code">
|
275
|
+
<tr>
|
276
|
+
<td>
|
277
|
+
<pre class="lines">
|
278
|
+
|
279
|
+
|
280
|
+
615
|
281
|
+
616
|
282
|
+
617
|
283
|
+
618</pre>
|
284
|
+
</td>
|
285
|
+
<td>
|
286
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 615</span>
|
287
|
+
|
288
|
+
<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>
|
289
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_accept_language'>parse_accept_language</span><span class='lparen'>(</span><span class='ivar'>@accept_language</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@languages</span>
|
290
|
+
<span class='op'>::</span><span class='const'>Brauser</span><span class='op'>::</span><span class='const'>Query</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='lparen'>(</span><span class='ivar'>@languages</span> <span class='op'>&</span> <span class='id identifier rubyid_langs'>langs</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='period'>.</span><span class='id identifier rubyid_uniq'>uniq</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_l'>l</span><span class='op'>|</span> <span class='id identifier rubyid_l'>l</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span> <span class='rbrace'>}</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_present?'>present?</span><span class='rparen'>)</span>
|
291
|
+
<span class='kw'>end</span></pre>
|
292
|
+
</td>
|
293
|
+
</tr>
|
294
|
+
</table>
|
295
|
+
</div>
|
296
|
+
|
297
|
+
<div class="method_details ">
|
298
|
+
<h3 class="signature " id="is-instance_method">
|
299
|
+
|
300
|
+
- (<tt><span class='object_link'><a href="../Query.html" title="Brauser::Query (class)">Query</a></span></tt>) <strong>is</strong>(names = [], versions = {}, platforms = [])
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
</h3><div class="docstring">
|
307
|
+
<div class="discussion">
|
308
|
+
<p>Checks if the browser is a specific name and optionally of a specific version and platform.</p>
|
309
|
+
|
310
|
+
|
311
|
+
</div>
|
312
|
+
</div>
|
313
|
+
<div class="tags">
|
314
|
+
<p class="tag_title">Parameters:</p>
|
315
|
+
<ul class="param">
|
316
|
+
|
317
|
+
<li>
|
318
|
+
|
319
|
+
<span class='name'>names</span>
|
320
|
+
|
321
|
+
|
322
|
+
<span class='type'>(<tt>Symbol|Array</tt>)</span>
|
323
|
+
|
324
|
+
|
325
|
+
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
326
|
+
|
327
|
+
|
328
|
+
—
|
329
|
+
<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>
|
330
|
+
</div>
|
331
|
+
|
332
|
+
</li>
|
333
|
+
|
334
|
+
<li>
|
335
|
+
|
336
|
+
<span class='name'>versions</span>
|
337
|
+
|
338
|
+
|
339
|
+
<span class='type'>(<tt>String|Hash</tt>)</span>
|
340
|
+
|
341
|
+
|
342
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
343
|
+
|
344
|
+
|
345
|
+
—
|
346
|
+
<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>
|
347
|
+
</div>
|
348
|
+
|
349
|
+
</li>
|
350
|
+
|
351
|
+
<li>
|
352
|
+
|
353
|
+
<span class='name'>platforms</span>
|
354
|
+
|
355
|
+
|
356
|
+
<span class='type'>(<tt>Symbol|Array</tt>)</span>
|
357
|
+
|
358
|
+
|
359
|
+
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
360
|
+
|
361
|
+
|
362
|
+
—
|
363
|
+
<div class='inline'><p>A list of specific platform to match. Valid values are all those possible for the platform attribute.</p>
|
364
|
+
</div>
|
365
|
+
|
366
|
+
</li>
|
367
|
+
|
368
|
+
</ul>
|
369
|
+
|
370
|
+
<p class="tag_title">Returns:</p>
|
371
|
+
<ul class="return">
|
372
|
+
|
373
|
+
<li>
|
374
|
+
|
375
|
+
|
376
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Query.html" title="Brauser::Query (class)">Query</a></span></tt>)</span>
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
—
|
381
|
+
<div class='inline'><p>A query which can evaluated for concatenation or result.</p>
|
382
|
+
</div>
|
383
|
+
|
384
|
+
</li>
|
385
|
+
|
386
|
+
</ul>
|
387
|
+
|
388
|
+
<p class="tag_title">See Also:</p>
|
389
|
+
<ul class="see">
|
390
|
+
|
391
|
+
<li>#v?</li>
|
392
|
+
|
393
|
+
<li>#on?</li>
|
394
|
+
|
395
|
+
</ul>
|
396
|
+
|
397
|
+
</div><table class="source_code">
|
398
|
+
<tr>
|
399
|
+
<td>
|
400
|
+
<pre class="lines">
|
401
|
+
|
402
|
+
|
403
|
+
569
|
404
|
+
570
|
405
|
+
571
|
406
|
+
572
|
407
|
+
573
|
408
|
+
574
|
409
|
+
575
|
410
|
+
576
|
411
|
+
577
|
412
|
+
578
|
413
|
+
579
|
414
|
+
580
|
415
|
+
581</pre>
|
416
|
+
</td>
|
417
|
+
<td>
|
418
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 569</span>
|
419
|
+
|
420
|
+
<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>
|
421
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_agent'>parse_agent</span><span class='lparen'>(</span><span class='ivar'>@agent</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@name</span>
|
422
|
+
|
423
|
+
<span class='id identifier rubyid_names'>names</span> <span class='op'>=</span> <span class='id identifier rubyid_adjust_names'>adjust_names</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span><span class='rparen'>)</span>
|
424
|
+
<span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='id identifier rubyid_parse_versions_query'>parse_versions_query</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span><span class='rparen'>)</span>
|
425
|
+
<span class='id identifier rubyid_platforms'>platforms</span> <span class='op'>=</span> <span class='id identifier rubyid_platforms'>platforms</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span>
|
426
|
+
|
427
|
+
<span class='op'>::</span><span class='const'>Brauser</span><span class='op'>::</span><span class='const'>Query</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span>
|
428
|
+
<span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span> <span class='op'>||</span> <span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='ivar'>@name</span><span class='rparen'>)</span> <span class='op'>&&</span> <span class='id identifier rubyid_check_capable'>check_capable</span><span class='lparen'>(</span><span class='id identifier rubyid_names'>names</span><span class='rparen'>)</span><span class='rparen'>)</span><span class='rparen'>)</span> <span class='op'>&&</span>
|
429
|
+
<span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</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><span class='rparen'>)</span> <span class='op'>&&</span>
|
430
|
+
<span class='lparen'>(</span><span class='id identifier rubyid_platforms'>platforms</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</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><span class='rparen'>)</span>
|
431
|
+
<span class='rparen'>)</span>
|
432
|
+
<span class='kw'>end</span></pre>
|
433
|
+
</td>
|
434
|
+
</tr>
|
435
|
+
</table>
|
436
|
+
</div>
|
437
|
+
|
438
|
+
<div class="method_details ">
|
439
|
+
<h3 class="signature " id="on-instance_method">
|
440
|
+
|
441
|
+
- (<tt><span class='object_link'><a href="../Query.html" title="Brauser::Query (class)">Query</a></span></tt>) <strong>on</strong>(platforms = [])
|
442
|
+
|
443
|
+
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
</h3><div class="docstring">
|
448
|
+
<div class="discussion">
|
449
|
+
<p>Check if the browser is on a specific platform.</p>
|
450
|
+
|
451
|
+
|
452
|
+
</div>
|
453
|
+
</div>
|
454
|
+
<div class="tags">
|
455
|
+
<p class="tag_title">Parameters:</p>
|
456
|
+
<ul class="param">
|
457
|
+
|
458
|
+
<li>
|
459
|
+
|
460
|
+
<span class='name'>platforms</span>
|
461
|
+
|
462
|
+
|
463
|
+
<span class='type'>(<tt>Symbol|Array</tt>)</span>
|
464
|
+
|
465
|
+
|
466
|
+
<em class="default">(defaults to: <tt>[]</tt>)</em>
|
467
|
+
|
468
|
+
|
469
|
+
—
|
470
|
+
<div class='inline'><p>A list of specific platform to match.</p>
|
471
|
+
</div>
|
472
|
+
|
473
|
+
</li>
|
474
|
+
|
475
|
+
</ul>
|
476
|
+
|
477
|
+
<p class="tag_title">Returns:</p>
|
478
|
+
<ul class="return">
|
479
|
+
|
480
|
+
<li>
|
481
|
+
|
482
|
+
|
483
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Query.html" title="Brauser::Query (class)">Query</a></span></tt>)</span>
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
—
|
488
|
+
<div class='inline'><p>A query which can evaluated for concatenation or result.</p>
|
489
|
+
</div>
|
490
|
+
|
491
|
+
</li>
|
492
|
+
|
493
|
+
</ul>
|
494
|
+
|
495
|
+
</div><table class="source_code">
|
496
|
+
<tr>
|
497
|
+
<td>
|
498
|
+
<pre class="lines">
|
499
|
+
|
500
|
+
|
501
|
+
606
|
502
|
+
607
|
503
|
+
608
|
504
|
+
609</pre>
|
505
|
+
</td>
|
506
|
+
<td>
|
507
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 606</span>
|
508
|
+
|
509
|
+
<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>
|
510
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_agent'>parse_agent</span><span class='lparen'>(</span><span class='ivar'>@agent</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@platform</span>
|
511
|
+
<span class='op'>::</span><span class='const'>Brauser</span><span class='op'>::</span><span class='const'>Query</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_platforms'>platforms</span><span class='period'>.</span><span class='id identifier rubyid_blank?'>blank?</span> <span class='op'>||</span> <span class='id identifier rubyid_platforms'>platforms</span><span class='period'>.</span><span class='id identifier rubyid_ensure_array'>ensure_array</span><span class='period'>.</span><span class='id identifier rubyid_uniq'>uniq</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_p'>p</span><span class='op'>|</span> <span class='id identifier rubyid_p'>p</span><span class='period'>.</span><span class='id identifier rubyid_ensure_string'>ensure_string</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span> <span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span><span class='lparen'>(</span><span class='ivar'>@platform</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
512
|
+
<span class='kw'>end</span></pre>
|
513
|
+
</td>
|
514
|
+
</tr>
|
515
|
+
</table>
|
516
|
+
</div>
|
517
|
+
|
518
|
+
<div class="method_details ">
|
519
|
+
<h3 class="signature " id="v-instance_method">
|
520
|
+
|
521
|
+
- (<tt><span class='object_link'><a href="../Query.html" title="Brauser::Query (class)">Query</a></span></tt>) <strong>v</strong>(versions = {})
|
522
|
+
|
523
|
+
|
524
|
+
|
525
|
+
|
526
|
+
|
527
|
+
</h3><div class="docstring">
|
528
|
+
<div class="discussion">
|
529
|
+
<p>Checks if the brower is a specific version.</p>
|
530
|
+
|
531
|
+
|
532
|
+
</div>
|
533
|
+
</div>
|
534
|
+
<div class="tags">
|
535
|
+
<p class="tag_title">Parameters:</p>
|
536
|
+
<ul class="param">
|
537
|
+
|
538
|
+
<li>
|
539
|
+
|
540
|
+
<span class='name'>versions</span>
|
541
|
+
|
542
|
+
|
543
|
+
<span class='type'>(<tt>String|Hash</tt>)</span>
|
544
|
+
|
545
|
+
|
546
|
+
<em class="default">(defaults to: <tt>{}</tt>)</em>
|
547
|
+
|
548
|
+
|
549
|
+
—
|
550
|
+
<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>
|
551
|
+
</div>
|
552
|
+
|
553
|
+
</li>
|
554
|
+
|
555
|
+
</ul>
|
556
|
+
|
557
|
+
<p class="tag_title">Returns:</p>
|
558
|
+
<ul class="return">
|
559
|
+
|
560
|
+
<li>
|
561
|
+
|
562
|
+
|
563
|
+
<span class='type'>(<tt><span class='object_link'><a href="../Query.html" title="Brauser::Query (class)">Query</a></span></tt>)</span>
|
564
|
+
|
565
|
+
|
566
|
+
|
567
|
+
—
|
568
|
+
<div class='inline'><p>A query which can evaluated for concatenation or result.</p>
|
569
|
+
</div>
|
570
|
+
|
571
|
+
</li>
|
572
|
+
|
573
|
+
</ul>
|
574
|
+
|
575
|
+
</div><table class="source_code">
|
576
|
+
<tr>
|
577
|
+
<td>
|
578
|
+
<pre class="lines">
|
579
|
+
|
580
|
+
|
581
|
+
587
|
582
|
+
588
|
583
|
+
589
|
584
|
+
590
|
585
|
+
591
|
586
|
+
592
|
587
|
+
593
|
588
|
+
594
|
589
|
+
595
|
590
|
+
596
|
591
|
+
597
|
592
|
+
598
|
593
|
+
599
|
594
|
+
600</pre>
|
595
|
+
</td>
|
596
|
+
<td>
|
597
|
+
<pre class="code"><span class="info file"># File 'lib/brauser/browser.rb', line 587</span>
|
598
|
+
|
599
|
+
<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>
|
600
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_parse_agent'>parse_agent</span><span class='lparen'>(</span><span class='ivar'>@agent</span><span class='rparen'>)</span> <span class='kw'>if</span> <span class='op'>!</span><span class='ivar'>@version</span>
|
601
|
+
<span class='id identifier rubyid_rv'>rv</span> <span class='op'>=</span> <span class='kw'>true</span>
|
602
|
+
|
603
|
+
<span class='id identifier rubyid_versions'>versions</span> <span class='op'>=</span> <span class='kw'>if</span> <span class='id identifier rubyid_versions'>versions</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span> <span class='kw'>then</span>
|
604
|
+
<span class='id identifier rubyid_parse_versions_query'>parse_versions_query</span><span class='lparen'>(</span><span class='id identifier rubyid_versions'>versions</span><span class='rparen'>)</span>
|
605
|
+
<span class='kw'>elsif</span> <span class='op'>!</span><span class='id identifier rubyid_versions'>versions</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='op'>::</span><span class='const'>Hash</span><span class='rparen'>)</span> <span class='kw'>then</span>
|
606
|
+
<span class='lbrace'>{</span><span class='rbrace'>}</span>
|
607
|
+
<span class='kw'>else</span>
|
608
|
+
<span class='id identifier rubyid_versions'>versions</span>
|
609
|
+
<span class='kw'>end</span>
|
610
|
+
|
611
|
+
<span class='op'>::</span><span class='const'>Brauser</span><span class='op'>::</span><span class='const'>Query</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='kw'>self</span><span class='comma'>,</span> <span class='id identifier rubyid_versions'>versions</span><span class='period'>.</span><span class='id identifier rubyid_all?'>all?</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_operator'>operator</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span> <span class='const'>Brauser</span><span class='op'>::</span><span class='const'>Browser</span><span class='period'>.</span><span class='id identifier rubyid_compare_versions'>compare_versions</span><span class='lparen'>(</span><span class='ivar'>@version</span><span class='comma'>,</span> <span class='id identifier rubyid_operator'>operator</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
|
612
|
+
<span class='kw'>end</span></pre>
|
613
|
+
</td>
|
614
|
+
</tr>
|
615
|
+
</table>
|
616
|
+
</div>
|
617
|
+
|
618
|
+
</div>
|
619
|
+
|
620
|
+
</div>
|
621
|
+
|
622
|
+
<div id="footer">
|
623
|
+
Generated on Sat Feb 2 17:47:19 2013 by
|
624
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
625
|
+
0.8.3 (ruby-1.9.3).
|
626
|
+
</div>
|
627
|
+
|
628
|
+
</body>
|
629
|
+
</html>
|