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