Module: Octokit::Client::Downloads

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

Instance Method Summary collapse

Instance Method Details

#download(repo, id, options = {}) ⇒ Download

Get single download for a repository

Examples:

Get the “Robawt” download from Github/Hubot

Octokit.download("github/hubot")

Parameters:

  • repo (String, Repository, Hash)

    A GitHub repository

  • id (Integer)

    ID of the download

Returns:

  • (Download)

    A single download from the repository

See Also:



24
25
26
# File 'lib/octokit/client/downloads.rb', line 24

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

#downloads(repo, options = {}) ⇒ Array

List available downloads for a repository

Examples:

List all downloads for Github/Hubot

Octokit.downloads("github/hubot")

Parameters:

  • repo (String, Repository, Hash)

    A Github Repository

Returns:

  • (Array)

    A list of available downloads

See Also:



12
13
14
# File 'lib/octokit/client/downloads.rb', line 12

def downloads(repo, options={})
  get("repos/#{Repository.new(repo)}/downloads", options, 3)
end