class Github::Client::Repos::Branches

Public Instance Methods

all(*args)
Alias for: list
find(*args)
Alias for: get
get(*args) click to toggle source

Get branch

@example

github = Github.new
github.repos.branches.get 'user-name', 'repo-name', 'branch-name'
github.repos.branches.get user: 'user-name', repo: 'repo-name', branch: 'branch-name'
github.repos(user: 'user-name', repo: 'repo-name', branch: 'branch-name').branches.get

@api public

# File lib/github_api/client/repos/branches.rb, line 41
def get(*args)
  arguments(args, required: [:user, :repo, :branch])

  get_request("/repos/#{arguments.user}/#{arguments.repo}/branches/#{arguments.branch}", arguments.params)
end
Also aliased as: find
list(*args) { |el| ... } click to toggle source

List branches

@example

github = Github.new
github.repos.branches.list 'user-name', 'repo-name'
github.repos(user: 'user-name', repo: 'repo-name').branches.list

@example

repos = Github::Repos.new
repos.branches.list 'user-name', 'repo-name'

@api public

# File lib/github_api/client/repos/branches.rb, line 24
def list(*args)
  arguments(args, required: [:user, :repo])

  response = get_request("/repos/#{arguments.user}/#{arguments.repo}/branches", arguments.params)
  return response unless block_given?
  response.each { |el| yield el }
end
Also aliased as: all