Class: Aranha::Selenium::DriverFactory::Base
- Inherits:
-
Object
- Object
- Aranha::Selenium::DriverFactory::Base
- Defined in:
- lib/aranha/selenium/driver_factory/base.rb
Constant Summary collapse
- DEFAULT_DOWNLOADS_DIR =
::File.join(::Dir.tmpdir, 'aranha_downloads_dir')
- DEFAULT_ACCEPT_INSECURE_CERTS =
false
- DEFAULT_HEADLESS =
false
- DEFAULT_USER_AGENT =
nil
Class Attribute Summary collapse
- .default_accept_insecure_certs ⇒ Object
- .default_downloads_dir ⇒ Object
- .default_headless ⇒ Object
- .default_user_agent ⇒ Object
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #accept_insecure_certs? ⇒ Boolean
- #build ⇒ Object
- #downloads_dir ⇒ Object
- #headless? ⇒ Boolean
-
#initialize(options) ⇒ Base
constructor
A new instance of Base.
- #user_agent ⇒ Object
Constructor Details
#initialize(options) ⇒ Base
Returns a new instance of Base.
38 39 40 |
# File 'lib/aranha/selenium/driver_factory/base.rb', line 38 def initialize() @options = .with_indifferent_access.freeze end |
Class Attribute Details
.default_accept_insecure_certs ⇒ Object
23 24 25 |
# File 'lib/aranha/selenium/driver_factory/base.rb', line 23 def default_accept_insecure_certs @default_accept_insecure_certs || DEFAULT_ACCEPT_INSECURE_CERTS end |
.default_downloads_dir ⇒ Object
19 20 21 |
# File 'lib/aranha/selenium/driver_factory/base.rb', line 19 def default_downloads_dir @default_downloads_dir || DEFAULT_DOWNLOADS_DIR end |
.default_headless ⇒ Object
27 28 29 |
# File 'lib/aranha/selenium/driver_factory/base.rb', line 27 def default_headless @default_headless || DEFAULT_HEADLESS end |
.default_user_agent ⇒ Object
31 32 33 |
# File 'lib/aranha/selenium/driver_factory/base.rb', line 31 def default_user_agent @default_user_agent || DEFAULT_USER_AGENT end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
36 37 38 |
# File 'lib/aranha/selenium/driver_factory/base.rb', line 36 def @options end |
Instance Method Details
#accept_insecure_certs? ⇒ Boolean
50 51 52 |
# File 'lib/aranha/selenium/driver_factory/base.rb', line 50 def accept_insecure_certs? option_value(:accept_insecure_certs) end |
#build ⇒ Object
42 43 44 |
# File 'lib/aranha/selenium/driver_factory/base.rb', line 42 def build raise 'Must be overrided' end |
#downloads_dir ⇒ Object
46 47 48 |
# File 'lib/aranha/selenium/driver_factory/base.rb', line 46 def downloads_dir option_value(:downloads_dir) end |
#headless? ⇒ Boolean
54 55 56 |
# File 'lib/aranha/selenium/driver_factory/base.rb', line 54 def headless? option_value(:headless) end |
#user_agent ⇒ Object
58 59 60 |
# File 'lib/aranha/selenium/driver_factory/base.rb', line 58 def user_agent option_value(:user_agent) end |