Class: Applitools::ImageMatchSettings

Inherits:
Object
  • Object
show all
Includes:
Jsonable, MatchLevelSetter
Defined in:
lib/applitools/core/image_match_settings.rb

Defined Under Namespace

Classes: Exact

Instance Method Summary collapse

Methods included from MatchLevelSetter

#match_level_with_exact

Methods included from Jsonable

included, #json, #json_data

Constructor Details

#initializeImageMatchSettings

Returns a new instance of ImageMatchSettings.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/applitools/core/image_match_settings.rb', line 13

def initialize
  self.accessibility_level = 'None'
  self.match_level = Applitools::MatchLevel::STRICT
  self.split_top_height = 0
  self.split_bottom_height = 0
  self.ignore_caret = true
  self.ignore_displacements = false
  self.accessibility = []
  self.ignore = []
  self.floating = []
  self.layout = []
  self.strict = []
  self.content = []
  self.exact = Exact.new
  self.scale = 0
  self.remainder = 0
  self.enable_patterns = false
  self.use_dom = false
end

Instance Method Details

#deep_dupObject



38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/applitools/core/image_match_settings.rb', line 38

def deep_dup
  cloned_value = self.class.new
  self.class.json_methods.keys.each do |f|
    new_value = case (v = send(f))
                when Symbol, FalseClass, TrueClass, Integer, Float
                  v
                else
                  v.clone
                end
    cloned_value.send("#{f}=", new_value)
  end
  cloned_value
end

#set_match_level(value, exact_options = {}) ⇒ Object



33
34
35
36
# File 'lib/applitools/core/image_match_settings.rb', line 33

def set_match_level(value, exact_options = {})
  (self.match_level, self.exact) = match_level_with_exact(value, exact_options)
  match_level
end