Module: Octokit::Client::Downloads

Included in:
Octokit::Client
Defined in:
lib/octokit/client/downloads.rb

Overview

Methods for the Repo Downloads API

Instance Method Summary collapse

Instance Method Details

#delete_download(repo, id, options = {}) ⇒ Boolean

Deprecated.

Delete a single download for a repository

Examples:

Get the "Robawt" download from Github/Hubot

Octokit.delete_download("github/hubot", 1234)

Parameters:

  • repo (Integer, String, Repository, Hash)

    A GitHub repository

  • id (Integer)

    ID of the download

Returns:

  • (Boolean)

    Status

See Also:



44
45
46
# File 'lib/octokit/client/downloads.rb', line 44

def delete_download(repo, id, options = {})
  boolean_from_response :delete, "#{Repository.path repo}/downloads/#{id}", options
end

#download(repo, id, options = {}) ⇒ Sawyer::Resource

Deprecated.

Get single download for a repository

Examples:

Get the "Robawt" download from Github/Hubot

Octokit.download("github/hubot")

Parameters:

  • repo (Integer, String, Repository, Hash)

    A GitHub repository

  • id (Integer)

    ID of the download

Returns:

  • (Sawyer::Resource)

    A single download from the repository

See Also:



31
32
33
# File 'lib/octokit/client/downloads.rb', line 31

def download(repo, id, options = {})
  get "#{Repository.path repo}/downloads/#{id}", options
end

#downloads(repo, options = {}) ⇒ Array Also known as: list_downloads

Deprecated.

List available downloads for a repository

Examples:

List all downloads for Github/Hubot

Octokit.downloads("github/hubot")

Parameters:

  • repo (Integer, String, Repository, Hash)

    A Github Repository

Returns:

  • (Array)

    A list of available downloads

See Also:



17
18
19
# File 'lib/octokit/client/downloads.rb', line 17

def downloads(repo, options = {})
  paginate "#{Repository.path repo}/downloads", options
end