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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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:



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

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