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.
Instance Attribute Summary collapse
-
#env ⇒ Object
readonly
The environment which this downloader is operating.
Instance Method Summary collapse
-
#download!(source_url, destination_file) ⇒ Object
Downloads the source file to the destination file.
-
#initialize(env) ⇒ Base
constructor
A new instance of Base.
-
#prepare(source_url) ⇒ Object
Called prior to execution so any error checks can be done.
Constructor Details
#initialize(env) ⇒ Base
Returns a new instance of Base.
11 12 13 |
# File 'lib/vagrant/downloaders/base.rb', line 11 def initialize(env) @env = env end |
Instance Attribute Details
#env ⇒ Object (readonly)
The environment which this downloader is operating.
9 10 11 |
# File 'lib/vagrant/downloaders/base.rb', line 9 def env @env 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.
20 |
# File 'lib/vagrant/downloaders/base.rb', line 20 def download!(source_url, destination_file); end |
#prepare(source_url) ⇒ Object
Called prior to execution so any error checks can be done
16 |
# File 'lib/vagrant/downloaders/base.rb', line 16 def prepare(source_url); end |