Class: Applitools::MatchResult

Inherits:
Object
  • Object
show all
Defined in:
lib/applitools/core/match_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_hash) ⇒ MatchResult

Returns a new instance of MatchResult.



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

def initialize(response_hash)
  Applitools::ArgumentGuard.hash response_hash, 'response hash', ['asExpected']
  @response_hash = response_hash
end

Instance Attribute Details

#response_hashObject (readonly)

Returns the value of attribute response_hash.



5
6
7
# File 'lib/applitools/core/match_result.rb', line 5

def response_hash
  @response_hash
end

#screenshotObject

Returns the value of attribute screenshot.



6
7
8
# File 'lib/applitools/core/match_result.rb', line 6

def screenshot
  @screenshot
end

Instance Method Details

#as_expected?Boolean

Returns:

  • (Boolean)


13
14
15
16
# File 'lib/applitools/core/match_result.rb', line 13

def as_expected?
  return response_hash['asExpected'] if [TrueClass, FalseClass].include? response_hash['asExpected'].class
  false
end