Class: AbstractDownloadStrategy
- Inherits:
-
Object
- Object
- AbstractDownloadStrategy
- Defined in:
- lib/lace/download_strategy.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#target_folder ⇒ Object
readonly
Returns the value of attribute target_folder.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
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.
- #name ⇒ Object
- #stage ⇒ Object
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
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
29 30 31 |
# File 'lib/lace/download_strategy.rb', line 29 def resource @resource end |
#target_folder ⇒ Object (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 |
#uri ⇒ Object (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
#fetch ⇒ Object
All download strategies are expected to implement these methods
38 |
# File 'lib/lace/download_strategy.rb', line 38 def fetch; end |
#name ⇒ Object
41 42 43 |
# File 'lib/lace/download_strategy.rb', line 41 def name @desired_package_name end |
#stage ⇒ Object
39 |
# File 'lib/lace/download_strategy.rb', line 39 def stage; end |