Class: Flunky::Configuration

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_optionsObject

Returns the value of attribute browser_options.



7
8
9
# File 'lib/flunky/configuration.rb', line 7

def browser_options
  @browser_options
end

#default_timeoutObject

Returns the value of attribute default_timeout.



7
8
9
# File 'lib/flunky/configuration.rb', line 7

def default_timeout
  @default_timeout
end

#headlessObject

Returns the value of attribute headless.



7
8
9
# File 'lib/flunky/configuration.rb', line 7

def headless
  @headless
end

#max_elementsObject

Returns the value of attribute max_elements.



7
8
9
# File 'lib/flunky/configuration.rb', line 7

def max_elements
  @max_elements
end

#process_timeoutObject

Returns the value of attribute process_timeout.



7
8
9
# File 'lib/flunky/configuration.rb', line 7

def process_timeout
  @process_timeout
end

#user_agentObject

Returns the value of attribute user_agent.



7
8
9
# File 'lib/flunky/configuration.rb', line 7

def user_agent
  @user_agent
end

#window_sizeObject

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_hObject



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: browser_options,
    process_timeout: process_timeout
  }
end