Class: URL Private

Inherits:
Object show all
Defined in:
url.rb

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, specs = {}) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:



12
13
14
15
16
17
# File 'url.rb', line 12

def initialize(url, specs = {})
  @url = url.freeze
  @specs = specs.dup
  @using = @specs.delete(:using)
  @specs.freeze
end

Instance Attribute Details

#specsObject (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



9
10
11
# File 'url.rb', line 9

def specs
  @specs
end

#usingObject (readonly)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.



9
10
11
# File 'url.rb', line 9

def using
  @using
end

Instance Method Details

#download_strategyT.class_of(AbstractDownloadStrategy)

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



25
26
27
# File 'url.rb', line 25

def download_strategy
  @download_strategy ||= DownloadStrategyDetector.detect(@url, @using)
end

#to_sString

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



20
21
22
# File 'url.rb', line 20

def to_s
  @url
end

#versionVersion

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:



30
31
32
# File 'url.rb', line 30

def version
  @version ||= Version.detect(@url, **@specs)
end