Class: ClimateControl::Modifier::OverlappingKeysWithChangedValues

Inherits:
Object
  • Object
show all
Defined in:
lib/climate_control/modifier.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash_1, hash_2) ⇒ OverlappingKeysWithChangedValues

Returns a new instance of OverlappingKeysWithChangedValues.



78
79
80
81
# File 'lib/climate_control/modifier.rb', line 78

def initialize(hash_1, hash_2)
  @hash_1 = hash_1 || {}
  @hash_2 = hash_2
end

Instance Method Details

#keysObject



83
84
85
86
87
# File 'lib/climate_control/modifier.rb', line 83

def keys
  overlapping_keys.select do |overlapping_key|
    @hash_1[overlapping_key] != @hash_2[overlapping_key]
  end
end