Sha256: 5a5598b957c5f19e510afd74623770dbb4def4b9cb4306cc2c5a3f85243fa29d

Contents?: true

Size: 1.17 KB

Versions: 14

Compression:

Stored size: 1.17 KB

Contents

# encoding: utf-8

module Github
  class Issues::Assignees < API

    # lists all the available assignees (owner + collaborators)
    # to which issues may be assigned.
    #
    # = Examples
    #
    #  Github.issues.assignees.list 'user', 'repo'
    #  Github.issues.assignees.list 'user', 'repo' { |assignee| ... }
    #
    def list(*args)
      arguments(args, :required => [:user, :repo])
      params = arguments.params

      response = get_request("/repos/#{user}/#{repo}/assignees", 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.
    #
    # = Examples
    #
    #  Github.issues.assignees.check 'user', 'repo', 'assignee'
    #
    #  github = Github.new user: 'user-name', repo: 'repo-name'
    #  github.issues.assignees.check 'assignee'
    #
    def check(*args)
      arguments(args, :required => [:user, :repo, :assignee])
      params = arguments.params

      get_request("/repos/#{user}/#{repo}/assignees/#{assignee}",params)
      true
    rescue Github::Error::NotFound
      false
    end

  end # Issues::Assignees
end # Github

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
github_api-0.11.3 lib/github_api/issues/assignees.rb
github_api-0.11.2 lib/github_api/issues/assignees.rb
github_api-0.11.1 lib/github_api/issues/assignees.rb
github_api-0.11.0 lib/github_api/issues/assignees.rb
github_api-0.10.2 lib/github_api/issues/assignees.rb
github_api-0.10.1 lib/github_api/issues/assignees.rb
github_api-0.10.0 lib/github_api/issues/assignees.rb
github_api-0.9.7 lib/github_api/issues/assignees.rb
github_api-0.9.6 lib/github_api/issues/assignees.rb
github_api-0.9.5 lib/github_api/issues/assignees.rb
github_api-0.9.4 lib/github_api/issues/assignees.rb
github_api-0.9.3 lib/github_api/issues/assignees.rb
github_api-0.9.2 lib/github_api/issues/assignees.rb
github_api-0.9.1 lib/github_api/issues/assignees.rb