Class: SuperDiff::ActiveSupport::OperationalSequencers::HashWithIndifferentAccess
- Inherits:
-
OperationalSequencers::Hash
- Object
- OperationalSequencers::Base
- OperationalSequencers::Hash
- SuperDiff::ActiveSupport::OperationalSequencers::HashWithIndifferentAccess
- Defined in:
- lib/super_diff/active_support/operational_sequencers/hash_with_indifferent_access.rb
Instance Method Summary collapse
-
#initialize(expected:, actual:, **rest) ⇒ HashWithIndifferentAccess
constructor
A new instance of HashWithIndifferentAccess.
Methods inherited from OperationalSequencers::Hash
Methods inherited from OperationalSequencers::Base
Constructor Details
#initialize(expected:, actual:, **rest) ⇒ HashWithIndifferentAccess
Returns a new instance of HashWithIndifferentAccess.
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/super_diff/active_support/operational_sequencers/hash_with_indifferent_access.rb', line 5 def initialize(expected:, actual:, **rest) super if expected.is_a?(::HashWithIndifferentAccess) @expected = expected.to_h @actual = actual.transform_keys(&:to_s) end if actual.is_a?(::HashWithIndifferentAccess) @expected = expected.transform_keys(&:to_s) @actual = actual.to_h end end |