Sha256: ad6ed21a95c25ef7f737a27b8eeb6271d3a07c17c34a667ec149911a298ba193

Contents?: true

Size: 1.11 KB

Versions: 10

Compression:

Stored size: 1.11 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(user_name, repo_name, params={})
      assert_presence_of user_name, repo_name
      normalize! params

      response = get_request("/repos/#{user_name}/#{repo_name}/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'
    #
    def check(user_name, repo_name, assignee, params={})
      assert_presence_of user_name, repo_name, assignee
      normalize! params

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

  end # Issues::Assignees
end # Github

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
github_api-0.9.0 lib/github_api/issues/assignees.rb
github_api-0.8.11 lib/github_api/issues/assignees.rb
github_api-0.8.10 lib/github_api/issues/assignees.rb
github_api-0.8.9 lib/github_api/issues/assignees.rb
github_api-0.8.8 lib/github_api/issues/assignees.rb
github_api-0.8.7 lib/github_api/issues/assignees.rb
github_api-0.8.6 lib/github_api/issues/assignees.rb
github_api-0.8.5 lib/github_api/issues/assignees.rb
github_api-0.8.4 lib/github_api/issues/assignees.rb
github_api-0.8.3 lib/github_api/issues/assignees.rb