Class: Applitools::AbstractConfiguration

Inherits:
Object
  • Object
show all
Extended by:
EyesConfigurationDSL
Defined in:
lib/applitools/core/abstract_configuration.rb

Direct Known Subclasses

EyesBaseConfiguration

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from EyesConfigurationDSL

accessor_methods, boolean_field, collect_method, enum_field, int_field, methods_to_delegate, object_field, string_field

Constructor Details

#initializeAbstractConfiguration

Returns a new instance of AbstractConfiguration.



11
12
13
14
15
16
17
18
# File 'lib/applitools/core/abstract_configuration.rb', line 11

def initialize
  @config_hash = {}
  self.validation_errors = {}
  default_config = self.class.default_config
  default_config.keys.each do |k|
    send "#{k}=", default_config[k]
  end
end

Instance Attribute Details

#config_hashObject (readonly)

Returns the value of attribute config_hash.



7
8
9
# File 'lib/applitools/core/abstract_configuration.rb', line 7

def config_hash
  @config_hash
end

#validation_errorsObject

Returns the value of attribute validation_errors.



8
9
10
# File 'lib/applitools/core/abstract_configuration.rb', line 8

def validation_errors
  @validation_errors
end

Instance Method Details

#deep_cloneObject Also known as: deep_dup



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/applitools/core/abstract_configuration.rb', line 20

def deep_clone
  new_config = self.class.new
  config_keys.each do |k|
    new_config.send(
      "#{k}=", case value = send(k)
               when Symbol, FalseClass, TrueClass, Integer, Float
                 value
               else
                 value.clone
               end
    )
  end
  new_config
end