Module: Brauser::Queryable::Queries
- Included in:
- Brauser::Query
- Defined in:
- lib/brauser/queryable/queries.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) version?(versions = {})
(also: #v?)
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.
55 56 57 |
# File 'lib/brauser/queryable/queries.rb', line 55 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
.
23 24 25 |
# File 'lib/brauser/queryable/queries.rb', line 23 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.
45 46 47 |
# File 'lib/brauser/queryable/queries.rb', line 45 def on?(platforms = []) @result ? @target.on?(platforms) : @result end |
- (Boolean) version?(versions = {}) Also known as: v?
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
.
34 35 36 |
# File 'lib/brauser/queryable/queries.rb', line 34 def version?(versions = {}) @result ? @target.version?(versions) : @result end |