Allow types to be specified when instantiating a typed hash

This commit is contained in:
sophia 2020-08-11 16:20:48 -05:00
parent bc898e385d
commit 1a3136b9fe
2 changed files with 6 additions and 3 deletions

View File

@ -270,9 +270,7 @@ module Vagrant
# If the file doesn't exist, we probably just have a machine created
# by a version of Vagrant that didn't cache shared folders. Report no
# shared folders to be safe.
folders = Vagrant::Util::TypedHash.new()
folders.types = {}
folders
Vagrant::Util::TypedHash.new(types: {})
end
end
end

View File

@ -5,6 +5,11 @@ module Vagrant
# Types available in the Hash
attr_accessor :types
def initialize(**opts)
if opts[:types]
@types = opts[:types]
end
end
end
end
end