Class: AbstractDownloadStrategy

Inherits:
Object
  • Object
show all
Defined in:
lib/lace/download_strategy.rb

Direct Known Subclasses

GitDownloadStrategy, LocalFileStrategy

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri, desired_package_name = nil) ⇒ AbstractDownloadStrategy

Returns a new instance of AbstractDownloadStrategy.



31
32
33
34
35
# File 'lib/lace/download_strategy.rb', line 31

def initialize(uri, desired_package_name = nil)
  @desired_package_name = desired_package_name
  @uri = uri
  @target_folder = Lace.pkgs_folder / name
end

Instance Attribute Details

#resourceObject (readonly)

Returns the value of attribute resource.



29
30
31
# File 'lib/lace/download_strategy.rb', line 29

def resource
  @resource
end

#target_folderObject (readonly)

Returns the value of attribute target_folder.



29
30
31
# File 'lib/lace/download_strategy.rb', line 29

def target_folder
  @target_folder
end

#uriObject (readonly)

Returns the value of attribute uri.



29
30
31
# File 'lib/lace/download_strategy.rb', line 29

def uri
  @uri
end

Instance Method Details

#fetchObject

All download strategies are expected to implement these methods



38
# File 'lib/lace/download_strategy.rb', line 38

def fetch; end

#nameObject



41
42
43
# File 'lib/lace/download_strategy.rb', line 41

def name
  @desired_package_name
end

#stageObject



39
# File 'lib/lace/download_strategy.rb', line 39

def stage; end