Represents a single version within the metadata.
The version that this Version object represents.
@return [String]
# File lib/vagrant/box_metadata.rb, line 85 def initialize(raw=nil) return if !raw @version = raw["version"] @provider_map = (raw["providers"] || []).map do |p| [p["name"].to_sym, p] end @provider_map = Hash[@provider_map] end
Returns a [Provider] for the given name, or nil if it isn't supported by this version.
# File lib/vagrant/box_metadata.rb, line 97 def provider(name) p = @provider_map[name.to_sym] return nil if !p Provider.new(p) end
Returns the providers that are available for this version of the box.
@return [Array<Symbol>]
# File lib/vagrant/box_metadata.rb, line 107 def providers @provider_map.keys.map(&:to_sym) end