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.
98 99 100 |
# File 'lib/brauser/query.rb', line 98 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
.
67 68 69 |
# File 'lib/brauser/query.rb', line 67 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.
88 89 90 |
# File 'lib/brauser/query.rb', line 88 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
.
78 79 80 |
# File 'lib/brauser/query.rb', line 78 def v?(versions = {}) @result ? @target.v?(versions) : @result end |