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.



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

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

#nameObject (readonly)

Returns the value of attribute name.



27
28
29
# File 'lib/lace/download_strategy.rb', line 27

def name
  @name
end

#resourceObject (readonly)

Returns the value of attribute resource.



27
28
29
# File 'lib/lace/download_strategy.rb', line 27

def resource
  @resource
end

#target_folderObject (readonly)

Returns the value of attribute target_folder.



27
28
29
# File 'lib/lace/download_strategy.rb', line 27

def target_folder
  @target_folder
end

Instance Method Details

#fetchObject

All download strategies are expected to implement these methods



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

def fetch; end

#stageObject



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

def stage; end

#uriObject



35
36
37
# File 'lib/lace/download_strategy.rb', line 35

def uri
  @uri
end