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

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

Class Method Summary collapse

Methods inherited from Core::AbstractDiffer

#call

Class Method Details

.applies_to?(expected, actual) ⇒ Boolean

Returns:

  • (Boolean)


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

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