class Github::Client::Repos::Projects

Public Instance Methods

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

Create a new project for the specified repo

@param [Hash] params @option params [String] :name

Required string - The name of the project.

@option params [String] :body

Optional string - The body of the project.

@example

github = Github.new
github.repos.projects.create 'owner-name', 'repo-name', name: 'project-name'
github.repos.projects.create name: 'project-name', body: 'project-body', owner: 'owner-name', repo: 'repo-name'

@api public

# File lib/github_api/client/repos/projects.rb, line 51
def create(*args)
  arguments(args, required: [:owner, :repo]) do
    assert_required %w[ name ]
  end
  params = arguments.params

  params["accept"] ||= PREVIEW_MEDIA

  post_request("/repos/#{arguments.owner}/#{arguments.repo}/projects", params)
end
list(*args) { |el| ... } click to toggle source

List a repo's projects

@example

github = Github.new
github.repos.projects.list owner: 'owner-name', repo: 'repo-name'

@example

github = Github.new
github.repos.projects.list state: 'open', owner: 'owner-name', repo: 'repo-name'

@example

github.repos.projects.list owner: 'owner-name', repo: 'repo-name' { |cbr| .. }

@return [Array]

@api public

# File lib/github_api/client/repos/projects.rb, line 25
def list(*args)
  arguments(args, required: [:owner, :repo])
  params = arguments.params

  params["accept"] ||= PREVIEW_MEDIA

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