Module: Brauser::Browseable::Querying
- Included in:
- Brauser::Browser
- Defined in:
- lib/brauser/browseable/querying.rb
Overview
Methods to end querying.
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) supported?(supported)
Check if the browser is supported.
-
- (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.
48 49 50 |
# File 'lib/brauser/browseable/querying.rb', line 48 def accepts?(langs = []) 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.
22 23 24 |
# File 'lib/brauser/browseable/querying.rb', line 22 def is?(names = [], versions = {}, platforms = []) is(names, versions, platforms).result end |
- (Boolean) on?(platforms = [])
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 |
- (Boolean) supported?(supported)
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 |
- (Boolean) version?(versions = {}) 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 |