Class: Vagrant::Downloaders::Base
- Inherits:
-
Object
- Object
- Vagrant::Downloaders::Base
- Includes:
- Util
- Defined in:
- lib/vagrant/downloaders/base.rb
Overview
Represents a base class for a downloader. A downloader handles downloading a box file to a temporary file.
Class Method Summary collapse
-
.match?(url) ⇒ Boolean
Tests whether a URL matches this download.
Instance Method Summary collapse
-
#download!(source_url, destination_file) ⇒ Object
Downloads the source file to the destination file.
-
#initialize(ui) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(ui) ⇒ Base
Returns a new instance of Base.
8 9 10 |
# File 'lib/vagrant/downloaders/base.rb', line 8 def initialize(ui) @ui = ui end |
Class Method Details
.match?(url) ⇒ Boolean
Tests whether a URL matches this download. Subclasses must override this and return ‘true` for any URLs they wish to handle.
15 |
# File 'lib/vagrant/downloaders/base.rb', line 15 def self.match?(url); false; end |
Instance Method Details
#download!(source_url, destination_file) ⇒ Object
Downloads the source file to the destination file. It is up to implementors of this class to handle the logic.
19 |
# File 'lib/vagrant/downloaders/base.rb', line 19 def download!(source_url, destination_file); end |