Class: SuperDiff::ActiveSupport::Differs::HashWithIndifferentAccess

Inherits:
Differs::Hash show all
Defined in:
lib/super_diff/active_support/differs/hash_with_indifferent_access.rb

Class Method Summary collapse

Methods inherited from Differs::Base

#call

Class Method Details

.applies_to?(expected, actual) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
8
9
10
11
12
13
# File 'lib/super_diff/active_support/differs/hash_with_indifferent_access.rb', line 5

def self.applies_to?(expected, actual)
  (
    expected.is_a?(::HashWithIndifferentAccess) && actual.is_a?(::Hash)
  ) ||
    (
      expected.is_a?(::Hash) &&
        actual.is_a?(::HashWithIndifferentAccess)
    )
end