Class: Capybara::Maleficent::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/capybara/maleficent/configuration.rb

Overview

Responsible for managing the configuration of Capybara::Maleficent

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**kargs) ⇒ Configuration

Returns a new instance of Configuration.



8
9
10
11
12
# File 'lib/capybara/maleficent/configuration.rb', line 8

def initialize(**kargs)
  self.sleep_durations = kargs.fetch(:sleep_durations) { [3, 10] }
  self.handled_exceptions = kargs.fetch(:handled_exceptions) { [] }
  self.logger = kargs.fetch(:logger) { Capybara::Maleficent::Logger.new }
end

Instance Attribute Details

#handled_exceptionsObject

Returns the value of attribute handled_exceptions.



14
15
16
# File 'lib/capybara/maleficent/configuration.rb', line 14

def handled_exceptions
  @handled_exceptions
end

#loggerObject

Returns the value of attribute logger.



16
17
18
# File 'lib/capybara/maleficent/configuration.rb', line 16

def logger
  @logger
end

#sleep_durationsObject

Used to determine the number of sleeps to attempt, and the duration of each of those sleeps.

Returns:

  • An array of integers



20
21
22
# File 'lib/capybara/maleficent/configuration.rb', line 20

def sleep_durations
  @sleep_durations
end