123456789_123456789_123456789_123456789_123456789_

Module: Octokit::Client::Downloads

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/octokit/client/downloads.rb

Overview

Methods for the Repo Downloads API

Instance Method Summary

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:

[ GitHub ]

  
# 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:

[ GitHub ]

  
# 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:

Returns:

  • (Array)

    A list of available downloads

See Also:

[ GitHub ]

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

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

#list_downloads(repo, options = {})

Alias for #downloads.

[ GitHub ]

  
# File 'lib/octokit/client/downloads.rb', line 20

alias list_downloads downloads