Class: ClimateControl::Modifier
- Inherits:
-
Object
- Object
- ClimateControl::Modifier
- Defined in:
- lib/climate_control/modifier.rb
Defined Under Namespace
Classes: OverlappingKeysWithChangedValues
Instance Method Summary collapse
-
#initialize(env, environment_overrides = {}, &block) ⇒ Modifier
constructor
A new instance of Modifier.
- #process ⇒ Object
Constructor Details
#initialize(env, environment_overrides = {}, &block) ⇒ Modifier
Returns a new instance of Modifier.
3 4 5 6 7 |
# File 'lib/climate_control/modifier.rb', line 3 def initialize(env, environment_overrides = {}, &block) @environment_overrides = stringify_keys(environment_overrides) @block = block @env = env end |
Instance Method Details
#process ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/climate_control/modifier.rb', line 9 def process @env.synchronize do begin prepare_environment_for_block run_block ensure cache_environment_after_block delete_keys_that_do_not_belong revert_changed_keys end end end |