Class: Hbc::AbstractDownloadStrategy

Inherits:
Object
  • Object
show all
Defined in:
Library/Homebrew/cask/lib/hbc/download_strategy.rb

Direct Known Subclasses

CurlDownloadStrategy, HbVCSDownloadStrategy

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#caskObject (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

#nameObject (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_objectObject (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

#urlObject (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

#versionObject (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_locationObject



28
# File 'Library/Homebrew/cask/lib/hbc/download_strategy.rb', line 28

def cached_location; end

#clear_cacheObject



30
# File 'Library/Homebrew/cask/lib/hbc/download_strategy.rb', line 30

def clear_cache; end

#fetchObject

All download strategies are expected to implement these methods



26
# File 'Library/Homebrew/cask/lib/hbc/download_strategy.rb', line 26

def fetch; end