Module: Brauser::Queries
- Included in:
- Query
- Defined in:
- lib/brauser/query.rb
Overview
Methods to make queries.
Instance Method Summary (collapse)
-
- (Boolean) accepts?(langs = [])
Check if the browser accepts the specified languages.
-
- (Boolean) is?(names = [], versions = {}, platforms = [])
Checks if the browser is a specific name and optionally of a specific version and platform.
-
- (Boolean) on?(platforms = [])
Check if the browser is on a specific platform.
-
- (Boolean) v?(versions = {})
Checks if the browser is a specific version.
Instance Method Details
- (Boolean) accepts?(langs = [])
Check if the browser accepts the specified languages.
This version returns a boolean and it is equal to append a call to #result
to the method `#accepts.
96 97 98 |
# File 'lib/brauser/query.rb', line 96 def accepts?(langs = []) @result ? @target.accepts?(langs) : @result end |
- (Boolean) is?(names = [], versions = {}, platforms = [])
Checks if the browser is a specific name and optionally of a specific version and platform.
This version returns a boolean and it is equal to append a call to #result
to the method #is
.
66 67 68 |
# File 'lib/brauser/query.rb', line 66 def is?(names = [], versions = {}, platforms = []) @result ? @target.is?(names, versions, platforms) : @result end |
- (Boolean) on?(platforms = [])
Check if the browser is on a specific platform.
This version returns a boolean and it is equal to append a call to #result
to the method `#on.
86 87 88 |
# File 'lib/brauser/query.rb', line 86 def on?(platforms = []) @result ? @target.on?(platforms) : @result end |
- (Boolean) v?(versions = {})
Checks if the browser is a specific version.
This version returns a boolean and it is equal to append a call to #result
to the method #v
.
76 77 78 |
# File 'lib/brauser/query.rb', line 76 def v?(versions = {}) @result ? @target.v?(versions) : @result end |