Module: Brauser::Queries
- Included in:
- Query
- Defined in:
- lib/brauser/query.rb
Overview
Methods to make queries.
Instance Method Summary collapse
-
#accepts?(langs = []) ⇒ Boolean
Check if the browser accepts the specified languages.
-
#is?(names = [], versions = {}, platforms = []) ⇒ Boolean
Checks if the browser is a specific name and optionally of a specific version and platform.
-
#on?(platforms = []) ⇒ Boolean
Check if the browser is on a specific platform.
-
#v?(versions = {}) ⇒ Boolean
Checks if the browser is a specific version.
Instance Method Details
#accepts?(langs = []) ⇒ Boolean
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 |
#is?(names = [], versions = {}, platforms = []) ⇒ Boolean
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 |
#on?(platforms = []) ⇒ Boolean
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 |
#v?(versions = {}) ⇒ Boolean
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 |