Class: Vagrant::BoxMetadata::Remote::Version
- Inherits:
-
Object
- Object
- Vagrant::BoxMetadata::Remote::Version
- Defined in:
- lib/vagrant/box_metadata/remote.rb
Defined Under Namespace
Classes: Provider
Instance Attribute Summary collapse
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(raw = nil, ver: nil, client: nil) ⇒ Version
constructor
A new instance of Version.
- #provider(name) ⇒ Object
- #providers ⇒ Object
Constructor Details
#initialize(raw = nil, ver: nil, client: nil) ⇒ Version
Returns a new instance of Version.
58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/vagrant/box_metadata/remote.rb', line 58 def initialize(raw=nil, ver: nil, client: nil) return if raw.nil? @logger = Log4r::Logger.new("vagrant::box::version") @version = ver if client.nil? raise ArgumentError, "Remote client is required for `#{self.class.name}'" end @client = client end |
Instance Attribute Details
#version ⇒ Object
Returns the value of attribute version.
56 57 58 |
# File 'lib/vagrant/box_metadata/remote.rb', line 56 def version @version end |
Instance Method Details
#provider(name) ⇒ Object
70 71 72 73 |
# File 'lib/vagrant/box_metadata/remote.rb', line 70 def provider(name) p = @client.provider(@version, name) Provider.new(p, client: @client) end |
#providers ⇒ Object
75 76 77 |
# File 'lib/vagrant/box_metadata/remote.rb', line 75 def providers @client.list_providers(@version) end |