Class: Hbc::AbstractDownloadStrategy
- Inherits:
-
Object
- Object
- Hbc::AbstractDownloadStrategy
- Defined in:
- Library/Homebrew/cask/lib/hbc/download_strategy.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#cask ⇒ Object
readonly
Returns the value of attribute cask.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#uri_object ⇒ Object
readonly
Returns the value of attribute uri_object.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #cached_location ⇒ Object
- #clear_cache ⇒ Object
-
#fetch ⇒ Object
All download strategies are expected to implement these methods.
-
#initialize(cask, command: SystemCommand) ⇒ AbstractDownloadStrategy
constructor
A new instance of AbstractDownloadStrategy.
Constructor Details
#initialize(cask, command: SystemCommand) ⇒ AbstractDownloadStrategy
Returns a new instance of AbstractDownloadStrategy
13 14 15 16 17 18 19 20 21 22 23 |
# File 'Library/Homebrew/cask/lib/hbc/download_strategy.rb', line 13 def initialize(cask, command: SystemCommand) @cask = cask @command = command # TODO: this excess of attributes is a function of integrating # with Homebrew's classes. Later we should be able to remove # these in favor of @cask @name = cask.token @url = cask.url.to_s @uri_object = cask.url @version = cask.version end |
Instance Attribute Details
#cask ⇒ Object (readonly)
Returns the value of attribute cask
11 12 13 |
# File 'Library/Homebrew/cask/lib/hbc/download_strategy.rb', line 11 def cask @cask end |
#name ⇒ Object (readonly)
Returns the value of attribute name
11 12 13 |
# File 'Library/Homebrew/cask/lib/hbc/download_strategy.rb', line 11 def name @name end |
#uri_object ⇒ Object (readonly)
Returns the value of attribute uri_object
11 12 13 |
# File 'Library/Homebrew/cask/lib/hbc/download_strategy.rb', line 11 def uri_object @uri_object end |
#url ⇒ Object (readonly)
Returns the value of attribute url
11 12 13 |
# File 'Library/Homebrew/cask/lib/hbc/download_strategy.rb', line 11 def url @url end |
#version ⇒ Object (readonly)
Returns the value of attribute version
11 12 13 |
# File 'Library/Homebrew/cask/lib/hbc/download_strategy.rb', line 11 def version @version end |
Instance Method Details
#cached_location ⇒ Object
28 |
# File 'Library/Homebrew/cask/lib/hbc/download_strategy.rb', line 28 def cached_location; end |
#clear_cache ⇒ Object
30 |
# File 'Library/Homebrew/cask/lib/hbc/download_strategy.rb', line 30 def clear_cache; end |
#fetch ⇒ Object
All download strategies are expected to implement these methods
26 |
# File 'Library/Homebrew/cask/lib/hbc/download_strategy.rb', line 26 def fetch; end |