Class: URL

Inherits:
Object show all
Defined in:
url.rb

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:



10
11
12
13
14
15
# File 'url.rb', line 10

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.

Returns the value of attribute specs.



7
8
9
# File 'url.rb', line 7

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.

Returns the value of attribute using.



7
8
9
# File 'url.rb', line 7

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:



23
24
25
# File 'url.rb', line 23

def download_strategy
  @download_strategy ||= DownloadStrategyDetector.detect(@url, @using)
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:



28
29
30
# File 'url.rb', line 28

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