Class: Flunky::Configuration
- Inherits:
-
Object
- Object
- Flunky::Configuration
- Defined in:
- lib/flunky/configuration.rb
Overview
Process-wide defaults. A Session merges these with its own keyword options, so per-session settings always win over the global configuration.
Instance Attribute Summary collapse
-
#browser_options ⇒ Object
Returns the value of attribute browser_options.
-
#default_timeout ⇒ Object
Returns the value of attribute default_timeout.
-
#headless ⇒ Object
Returns the value of attribute headless.
-
#max_elements ⇒ Object
Returns the value of attribute max_elements.
-
#process_timeout ⇒ Object
Returns the value of attribute process_timeout.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
-
#window_size ⇒ Object
Returns the value of attribute window_size.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 17 18 |
# File 'lib/flunky/configuration.rb', line 10 def initialize @headless = true @default_timeout = 10 @max_elements = 200 @window_size = [1280, 800] @user_agent = nil @browser_options = {} @process_timeout = nil end |
Instance Attribute Details
#browser_options ⇒ Object
Returns the value of attribute browser_options.
7 8 9 |
# File 'lib/flunky/configuration.rb', line 7 def @browser_options end |
#default_timeout ⇒ Object
Returns the value of attribute default_timeout.
7 8 9 |
# File 'lib/flunky/configuration.rb', line 7 def default_timeout @default_timeout end |
#headless ⇒ Object
Returns the value of attribute headless.
7 8 9 |
# File 'lib/flunky/configuration.rb', line 7 def headless @headless end |
#max_elements ⇒ Object
Returns the value of attribute max_elements.
7 8 9 |
# File 'lib/flunky/configuration.rb', line 7 def max_elements @max_elements end |
#process_timeout ⇒ Object
Returns the value of attribute process_timeout.
7 8 9 |
# File 'lib/flunky/configuration.rb', line 7 def process_timeout @process_timeout end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
7 8 9 |
# File 'lib/flunky/configuration.rb', line 7 def user_agent @user_agent end |
#window_size ⇒ Object
Returns the value of attribute window_size.
7 8 9 |
# File 'lib/flunky/configuration.rb', line 7 def window_size @window_size end |
Instance Method Details
#to_h ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/flunky/configuration.rb', line 20 def to_h { headless: headless, default_timeout: default_timeout, max_elements: max_elements, window_size: window_size, user_agent: user_agent, browser_options: , process_timeout: process_timeout } end |