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:



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

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.



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

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.



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

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:



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

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:



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

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