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