Module: Brauser::Browseable::Querying
- Included in:
- Brauser::Browser
- Defined in:
- lib/brauser/browseable/querying.rb
Overview
Methods to end querying.
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.
-
#supported?(supported) ⇒ Boolean
Check if the browser is supported.
-
#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.
48 49 50 |
# File 'lib/brauser/browseable/querying.rb', line 48 def accepts?(langs = []) 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.
22 23 24 |
# File 'lib/brauser/browseable/querying.rb', line 22 def is?(names = [], versions = {}, platforms = []) is(names, versions, platforms).result end |
#on?(platforms = []) ⇒ Boolean
Check if the browser is on a specific platform.
40 41 42 |
# File 'lib/brauser/browseable/querying.rb', line 40 def on?(platforms = []) on(platforms).result end |
#supported?(supported) ⇒ Boolean
Check if the browser is supported.
56 57 58 59 60 |
# File 'lib/brauser/browseable/querying.rb', line 56 def supported?(supported) supported = YAML.load_file(supported).symbolize_keys if supported.is_a?(String) minimum = supported[name] (minimum && v?(gte: minimum)).to_boolean end |
#version?(versions = {}) ⇒ Boolean Also known as: v?
Checks if the browser is a specific version.
31 32 33 |
# File 'lib/brauser/browseable/querying.rb', line 31 def version?(versions = {}) version(versions).result end |