Class: Ferrum::Browser::Options::Base
- Inherits:
-
Object
- Object
- Ferrum::Browser::Options::Base
- Includes:
- Singleton
- Defined in:
- lib/ferrum/browser/options/base.rb
Class Method Summary collapse
Instance Method Summary collapse
- #detect_path ⇒ Object
- #except(*keys) ⇒ Object
- #merge_default(flags, options) ⇒ Object
- #merge_required(flags, options, user_data_dir) ⇒ Object
- #to_h ⇒ Object
Class Method Details
permalink .options ⇒ Object
[View source]
12 13 14 |
# File 'lib/ferrum/browser/options/base.rb', line 12 def self. instance end |
permalink .version ⇒ String?
17 18 19 20 21 22 |
# File 'lib/ferrum/browser/options/base.rb', line 17 def self.version out, = Open3.capture2(instance.detect_path, "--version") out.strip rescue Errno::ENOENT nil end |
Instance Method Details
permalink #detect_path ⇒ Object
[View source]
32 33 34 |
# File 'lib/ferrum/browser/options/base.rb', line 32 def detect_path Binary.find(self.class::PLATFORM_PATH[Utils::Platform.name]) end |
permalink #except(*keys) ⇒ Object
[View source]
28 29 30 |
# File 'lib/ferrum/browser/options/base.rb', line 28 def except(*keys) to_h.reject { |n, _| keys.include?(n) } end |
permalink #merge_default(flags, options) ⇒ Object
40 41 42 |
# File 'lib/ferrum/browser/options/base.rb', line 40 def merge_default(flags, ) raise NotImplementedError end |
permalink #merge_required(flags, options, user_data_dir) ⇒ Object
36 37 38 |
# File 'lib/ferrum/browser/options/base.rb', line 36 def merge_required(flags, , user_data_dir) raise NotImplementedError end |
permalink #to_h ⇒ Object
[View source]
24 25 26 |
# File 'lib/ferrum/browser/options/base.rb', line 24 def to_h self.class::DEFAULT_OPTIONS end |