Sha256: 1cf36af90e33ea4aa93cbfad8fd049be242e3a079b5b5c6ecc21b079e3cad1bc

Contents?: true

Size: 1.24 KB

Versions: 16

Compression:

Stored size: 1.24 KB

Contents

# encoding: utf-8

module Github
  class Client::Issues::Assignees < API
    # 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
    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
    alias :all :list

    # 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
    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
  end # Issues::Assignees
end # Github

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
github_api-0.17.0 lib/github_api/client/issues/assignees.rb
github_api-0.16.0 lib/github_api/client/issues/assignees.rb
github_api-0.15.0 lib/github_api/client/issues/assignees.rb
github_api-0.14.5 lib/github_api/client/issues/assignees.rb
github_api-0.14.4 lib/github_api/client/issues/assignees.rb
github_api-0.14.3 lib/github_api/client/issues/assignees.rb
github_api-0.14.2 lib/github_api/client/issues/assignees.rb
github_api-0.14.1 lib/github_api/client/issues/assignees.rb
github_api-0.14.0 lib/github_api/client/issues/assignees.rb
github_api-0.13.1 lib/github_api/client/issues/assignees.rb
github_api-0.13.0 lib/github_api/client/issues/assignees.rb
github_api-0.12.4 lib/github_api/client/issues/assignees.rb
github_api-0.12.3 lib/github_api/client/issues/assignees.rb
github_api-0.12.2 lib/github_api/client/issues/assignees.rb
github_api-0.12.1 lib/github_api/client/issues/assignees.rb
github_api-0.12.0 lib/github_api/client/issues/assignees.rb