Class: Homebrew::API::JSONDownload Private

Inherits:
Object
  • Object
show all
Includes:
Downloadable
Defined in:
api/json_download.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

Attributes included from Downloadable

#checksum, #mirrors, #url

Instance Method Summary collapse

Methods included from Downloadable

#cached_download, #clear_cache, #download_name, #download_strategy, #downloaded?, #fetch, #freeze, #initialize_dup, #verify_download_integrity, #version

Methods included from Context

current, current=, #debug?, #quiet?, #verbose?, #with_context

Constructor Details

#initialize(url, target:, stale_seconds:) ⇒ 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:



34
35
36
37
38
39
# File 'api/json_download.rb', line 34

def initialize(url, target:, stale_seconds:)
  super()
  @url = T.let(URL.new(url, using: API::JSONDownloadStrategy, target:, stale_seconds:), URL)
  @target = target
  @stale_seconds = stale_seconds
end

Instance Method Details

#download_typeString

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:



50
# File 'api/json_download.rb', line 50

def download_type = "JSON API"

#downloaderAPI::JSONDownloadStrategy

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.



42
43
44
# File 'api/json_download.rb', line 42

def downloader
  T.cast(super, API::JSONDownloadStrategy)
end

#nameString

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:



47
# File 'api/json_download.rb', line 47

def name = download_name