Class: Applitools::AbstractConfiguration
- Inherits:
-
Object
- Object
- Applitools::AbstractConfiguration
- Extended by:
- EyesConfigurationDSL
- Defined in:
- lib/applitools/core/abstract_configuration.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#config_hash ⇒ Object
readonly
Returns the value of attribute config_hash.
-
#validation_errors ⇒ Object
Returns the value of attribute validation_errors.
Instance Method Summary collapse
- #deep_clone ⇒ Object (also: #deep_dup)
-
#initialize ⇒ AbstractConfiguration
constructor
A new instance of AbstractConfiguration.
Methods included from EyesConfigurationDSL
accessor_methods, boolean_field, collect_method, enum_field, int_field, methods_to_delegate, object_field, string_field
Constructor Details
#initialize ⇒ AbstractConfiguration
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_hash ⇒ Object (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_errors ⇒ Object
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_clone ⇒ Object 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 |