Module: Octokit::Client::Events

Included in:
Octokit::Client
Defined in:
lib/octokit/client/events.rb

Overview

Method for the Events API

Instance Method Summary collapse

Instance Method Details

#issue_event(repo, number, options = {}) ⇒ Sawyer::Resource

Get information on a single Issue Event

Examples:

Get Event information for ID 3094334 (a pull request was closed)

Octokit.issue_event("octokit/octokit.rb", 3094334)

Parameters:

  • repo (String, Repository, Hash)

    A GitHub repository

  • number (Integer)

    Event number

Returns:

  • (Sawyer::Resource)

    A single Event for an Issue

See Also:



142
143
144
# File 'lib/octokit/client/events.rb', line 142

def issue_event(repo, number, options = {})
  paginate "repos/#{Repository.new(repo)}/issues/events/#{number}", options
end

#issue_events(repo, number, options = {}) ⇒ Array<Sawyer::Resource>

List events for an Issue

Examples:

List all issues events for issue #38 on octokit/octokit.rb

Octokit.issue_events("octokit/octokit.rb", 38)

Parameters:

  • repo (String, Repository, Hash)

    A GitHub repository

  • number (Integer)

    Issue number

Returns:

  • (Array<Sawyer::Resource>)

    Array of events for that issue

See Also:



129
130
131
# File 'lib/octokit/client/events.rb', line 129

def issue_events(repo, number, options = {})
  paginate "repos/#{Repository.new(repo)}/issues/#{number}/events", options
end

#organization_events(org, options = {}) ⇒ Array<Sawyer::Resource>

List all events for an organization

Requires authenticated client.

Examples:

List events for the lostisland organization

@client.organization_events("lostisland")

Parameters:

  • org (String)

    Organization GitHub handle

Returns:

  • (Array<Sawyer::Resource>)

    List of all events from a GitHub organization

See Also:



92
93
94
# File 'lib/octokit/client/events.rb', line 92

def organization_events(org, options = {})
  paginate "users/#{}/events/orgs/#{org}", options
end

#organization_public_events(org, options = {}) ⇒ Array<Sawyer::Resource>

List an organization's public events

Examples:

List public events for GitHub

Octokit.organization_public_events("GitHub")

Parameters:

  • org (String)

    Organization GitHub username

Returns:

  • (Array<Sawyer::Resource>)

    List of public events from a GitHub organization

See Also:



103
104
105
# File 'lib/octokit/client/events.rb', line 103

def organization_public_events(org, options = {})
  paginate "orgs/#{org}/events", options
end

#public_events(options = {}) ⇒ Array<Sawyer::Resource>

List all public events for GitHub

Examples:

List all pubilc events

Octokit.public_events

Returns:

  • (Array<Sawyer::Resource>)

    A list of all public events from GitHub

See Also:



16
17
18
# File 'lib/octokit/client/events.rb', line 16

def public_events(options = {})
  paginate "events", options
end

#received_events(user, options = {}) ⇒ Array<Sawyer::Resource>

List events that a user has received

Examples:

List all user received events

Octokit.received_events("sferik")

Returns:

  • (Array<Sawyer::Resource>)

    A list of all user received events

See Also:



47
48
49
# File 'lib/octokit/client/events.rb', line 47

def received_events(user, options = {})
  paginate "users/#{user}/received_events", options
end

#received_public_events(user, options = {}) ⇒ Array<Sawyer::Resource>

List public events a user has received

Examples:

List public user received events

Octokit.received_public_events("sferik")

Returns:

  • (Array<Sawyer::Resource>)

    A list of public user received events

See Also:



57
58
59
# File 'lib/octokit/client/events.rb', line 57

def received_public_events(user, options = {})
  paginate "users/#{user}/received_events/public", options
end

#repository_events(repo, options = {}) ⇒ Array<Sawyer::Resource>

List events for a repository

Examples:

List events for a repository

Octokit.repository_events("sferik/rails_admin")

Parameters:

  • repo (String, Repository, Hash)

    A GitHub repository

Returns:

  • (Array<Sawyer::Resource>)

    A list of events for a repository

See Also:



68
69
70
# File 'lib/octokit/client/events.rb', line 68

def repository_events(repo, options = {})
  paginate "repos/#{Repository.new(repo)}/events", options
end

#repository_issue_events(repo, options = {}) ⇒ Array<Sawyer::Resource> Also known as: repo_issue_events

Get all Issue Events for a given Repository

Examples:

Get all Issue Events for Octokit

Octokit.repository_issue_events("octokit/octokit.rb")

Parameters:

  • repo (String, Repository, Hash)

    A GitHub repository

Returns:

  • (Array<Sawyer::Resource>)

    Array of all Issue Events for this Repository

See Also:



115
116
117
# File 'lib/octokit/client/events.rb', line 115

def repository_issue_events(repo, options = {})
  paginate "repos/#{Repository.new repo}/issues/events", options
end

#repository_network_events(repo, options = {}) ⇒ Array<Sawyer::Resource>

List public events for a repository's network

Examples:

List events for a repository's network

Octokit.repository_network_events("sferik/rails_admin")

Parameters:

  • repo (String, Repository, Hash)

    A GitHub repository

Returns:

  • (Array<Sawyer::Resource>)

    A list of events for a repository's network

See Also:



79
80
81
# File 'lib/octokit/client/events.rb', line 79

def repository_network_events(repo, options = {})
  paginate "networks/#{Repository.new repo}/events", options
end

#user_events(user, options = {}) ⇒ Array<Sawyer::Resource>

List all user events

Examples:

List all user events

Octokit.user_events("sferik")

Returns:

  • (Array<Sawyer::Resource>)

    A list of all user events

See Also:



26
27
28
# File 'lib/octokit/client/events.rb', line 26

def user_events(user, options = {})
  paginate "users/#{user}/events", options
end

#user_public_events(user, options = {}) ⇒ Array<Sawyer::Resource>

List public user events

Examples:

List public user events

Octokit.user_events("sferik")

Parameters:

  • user (String)

    GitHub username

Returns:

  • (Array<Sawyer::Resource>)

    A list of public user events

See Also:



37
38
39
# File 'lib/octokit/client/events.rb', line 37

def user_public_events(user, options = {})
  paginate "users/#{user}/events/public", options
end