Module: Brauser::BrowserMethods::Querying
- Included in:
- Brauser::Browser
- Defined in:
- lib/brauser/browser.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) v?(versions = {})
Checks if the browser is a specific version.
Instance Method Details
- (Boolean) accepts?(langs = [])
Check if the browser accepts the specified languages.
656 657 658 |
# File 'lib/brauser/browser.rb', line 656 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.
631 632 633 |
# File 'lib/brauser/browser.rb', line 631 def is?(names = [], versions = {}, platforms = []) is(names, versions, platforms).result end |
- (Boolean) on?(platforms = [])
Check if the browser is on a specific platform.
648 649 650 |
# File 'lib/brauser/browser.rb', line 648 def on?(platforms = []) on(platforms).result end |
- (Boolean) supported?(supported)
Check if the browser is supported.
664 665 666 667 668 |
# File 'lib/brauser/browser.rb', line 664 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) v?(versions = {})
Checks if the browser is a specific version.
640 641 642 |
# File 'lib/brauser/browser.rb', line 640 def v?(versions = {}) v(versions).result end |