Introduce merge function to preserve internal state

This commit is contained in:
Brian Cain 2018-03-14 15:54:38 -07:00
parent d26a925bd7
commit 607368a66c
No known key found for this signature in database
GPG Key ID: 43D51080D357A001
1 changed files with 13 additions and 0 deletions

View File

@ -102,6 +102,19 @@ module VagrantPlugins
return trigger return trigger
end end
# Solve the mystery of disappearing state??
def merge(other)
super.tap do |result|
other_defined_before_triggers = other.instance_variable_get(:@_before_triggers)
other_defined_after_triggers = other.instance_variable_get(:@_after_triggers)
#overrides???
result.instance_variable_set(:@_before_triggers, other_defined_before_triggers)
result.instance_variable_set(:@_after_triggers, other_defined_after_triggers)
end
end
def finalize! def finalize!
# read through configured settings blocks and set their values # read through configured settings blocks and set their values
# and then set up action hooks here? # and then set up action hooks here?