class Vagrant::Plugin::V2::SyncedFolder::Collection
Public Instance Methods
to_h()
click to toggle source
Converts to a regular Hash and removes plugin instances so the result is ready for serialization
@return [Hash]
Calls superclass method
# File lib/vagrant/plugin/v2/synced_folder.rb, line 28 def to_h c = lambda do |h| h.keys.each do |k| if h[k].is_a?(Hash) h[k] = c.call(h[k].to_h.clone) end end h end h = c.call(super) h.values.each do |f| f.values.each do |g| g.delete(:plugin) end end h end
type(t)
click to toggle source
Fetch the synced plugin folder of the given type
@param [Symbol] t Synced folder type @return [Vagrant::Plugin::V2::SyncedFolder]
# File lib/vagrant/plugin/v2/synced_folder.rb, line 17 def type(t) f = detect { |k, _| k.to_sym == t.to_sym }.last raise KeyError, "Unknown synced folder type" if !f f.values.first[:plugin] end
types()
click to toggle source
@return [Array<Symbol>] names of synced folder types
# File lib/vagrant/plugin/v2/synced_folder.rb, line 9 def types keys end