Class: AbstractDownloadStrategy
- Inherits:
-
Object
- Object
- AbstractDownloadStrategy
- Defined in:
- lib/lace/download_strategy.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#target_folder ⇒ Object
readonly
Returns the value of attribute target_folder.
Instance Method Summary collapse
-
#fetch ⇒ Object
All download strategies are expected to implement these methods.
-
#initialize(uri, desired_package_name = nil) ⇒ AbstractDownloadStrategy
constructor
A new instance of AbstractDownloadStrategy.
- #stage ⇒ Object
- #uri ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
27 28 29 |
# File 'lib/lace/download_strategy.rb', line 27 def name @name end |
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
27 28 29 |
# File 'lib/lace/download_strategy.rb', line 27 def resource @resource end |
#target_folder ⇒ Object (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
#fetch ⇒ Object
All download strategies are expected to implement these methods
40 |
# File 'lib/lace/download_strategy.rb', line 40 def fetch; end |
#stage ⇒ Object
41 |
# File 'lib/lace/download_strategy.rb', line 41 def stage; end |
#uri ⇒ Object
35 36 37 |
# File 'lib/lace/download_strategy.rb', line 35 def uri @uri end |