Class: Vagrant::Downloaders::Base

Inherits:
Object
  • Object
show all
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.

Direct Known Subclasses

File, HTTP

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#envObject (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