Class: Applitools::ImageMatchSettings::Exact

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

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Jsonable

included, #json, #json_data

Constructor Details

#initializeExact

Returns a new instance of Exact.



89
90
91
92
93
94
# File 'lib/applitools/core/image_match_settings.rb', line 89

def initialize
  self.min_diff_intensity = 0
  self.min_diff_width = 0
  self.min_diff_height = 0
  self.match_threshold = 0
end

Class Method Details

.from_exact_options(options) ⇒ Object



79
80
81
82
83
84
85
86
# File 'lib/applitools/core/image_match_settings.rb', line 79

def from_exact_options(options)
  new.tap do |exact|
    exact.min_diff_intensity = options['MinDiffIntensity']
    exact.min_diff_width = options['MinDiffWidth']
    exact.min_diff_height = options['MinDiffHeight']
    exact.match_threshold = options['MatchThreshold']
  end
end

Instance Method Details

#==(other) ⇒ Object



96
97
98
99
100
101
102
# File 'lib/applitools/core/image_match_settings.rb', line 96

def ==(other)
  return false unless other.is_a?(self.class)
  self.min_diff_intensity == other.min_diff_intensity &&
    self.min_diff_width == other.min_diff_width &&
    self.min_diff_height == other.min_diff_height &&
    self.match_threshold == other.match_threshold
end

#to_hashObject



104
105
106
107
108
109
110
111
# File 'lib/applitools/core/image_match_settings.rb', line 104

def to_hash
  {
    minDiffIntensity: self.min_diff_intensity,
    minDiffWidth: self.min_diff_width,
    minDiffHeight: self.min_diff_height,
    matchThreshold: self.match_threshold
  }
end