Properly clone mappers

This commit is contained in:
Chris Roberts 2022-04-06 14:13:09 -07:00 committed by Paul Hinze
parent 823e589a26
commit 2baea78820
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0

View File

@ -105,14 +105,10 @@ module VagrantPlugins
@@blind_maps ||= {}
end
# Create a clone of this mappers instance
#
# @return [Mappers]
def clone
self.class.new(*known_arguments).tap do |m|
m.cacher = cacher
m.mappers.replace(mappers.dup)
end
def initialize_copy(orig)
@mappers = orig.mappers.dup
@cacher = orig.cacher
@known_arguments = orig.known_arguments
end
# Add an argument to be included with mapping calls