class Github::Client::Issues::Assignees
Public Instance Methods
add(*args)
click to toggle source
Add assignees to an issue
@example
github = Github.new github.issues.assignees.add 'user', 'repo', 'issue-number', 'hubot', 'other_assignee', ...
@api public
# File lib/github_api/client/issues/assignees.rb, line 52 def add(*args) arguments(args, required: [:user, :repo, :number]) params = arguments.params params['data'] = { 'assignees' => arguments.remaining } unless arguments.remaining.empty? post_request("/repos/#{arguments.user}/#{arguments.repo}/issues/#{arguments.number}/assignees", params) end
Also aliased as: <<
check(*args)
click to toggle source
Check to see if a particular user is an assignee for a repository.
@example
Github.issues.assignees.check 'user', 'repo', 'assignee'
@example
github = Github.new user: 'user-name', repo: 'repo-name' github.issues.assignees.check 'assignee'
@api public
# File lib/github_api/client/issues/assignees.rb, line 34 def check(*args) arguments(args, required: [:owner, :repo, :assignee]) params = arguments.params get_request("/repos/#{arguments.owner}/#{arguments.repo}/assignees/#{arguments.assignee}",params) true rescue Github::Error::NotFound false end
list(*args) { |el| ... }
click to toggle source
Lists all the available assignees (owner + collaborators) to which issues may be assigned.
@example
Github.issues.assignees.list 'owner', 'repo' Github.issues.assignees.list 'owner', 'repo' { |assignee| ... }
@api public
# File lib/github_api/client/issues/assignees.rb, line 15 def list(*args) arguments(args, required: [:owner, :repo]) response = get_request("/repos/#{arguments.owner}/#{arguments.repo}/assignees", arguments.params) return response unless block_given? response.each { |el| yield el } end
Also aliased as: all
remove(*args)
click to toggle source
Remove a assignees from an issue
@example
github = Github.new github.issues.assignees.remove 'user', 'repo', 'issue-number', 'hubot', 'other_assignee'
@api public
# File lib/github_api/client/issues/assignees.rb, line 69 def remove(*args) arguments(args, required: [:user, :repo, :number]) params = arguments.params params['data'] = { 'assignees' => arguments.remaining } unless arguments.remaining.empty? delete_request("/repos/#{arguments.user}/#{arguments.repo}/issues/#{arguments.number}/assignees", params) end