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
# File 'lib/applitools/core/image_match_settings.rb', line 96

def ==(other)
  min_diff_intensity == other.min_diff_intensity &&
    min_diff_width == other.min_diff_width &&
    min_diff_height == other.min_diff_height &&
    match_threshold == other.match_threshold
end

#to_hashObject



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

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