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 (Integer, String, Repository, Hash)

    A GitHub repository

  • number (Integer)

    Event number

Returns:

  • (Sawyer::Resource)

    A single Event for an Issue

See Also:



146
147
148
# File 'lib/octokit/client/events.rb', line 146

def issue_event(repo, number, options = {})
  paginate "#{Repository.path 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 (Integer, String, Repository, Hash)

    A GitHub repository

  • number (Integer)

    Issue number

Returns:

  • (Array<Sawyer::Resource>)

    Array of events for that issue

See Also:



133
134
135
# File 'lib/octokit/client/events.rb', line 133

def issue_events(repo, number, options = {})
  paginate "#{Repository.path 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:



95
96
97
# File 'lib/octokit/client/events.rb', line 95

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, Integer)

    Organization GitHub login or id.

Returns:

  • (Array<Sawyer::Resource>)

    List of public events from a GitHub organization

See Also:



106
107
108
# File 'lib/octokit/client/events.rb', line 106

def organization_public_events(org, options = {})
  paginate "#{Organization.path 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")

Parameters:

  • user (Integer, String)

    GitHub user login or id

Returns:

  • (Array<Sawyer::Resource>)

    A list of all user received events

See Also:



49
50
51
# File 'lib/octokit/client/events.rb', line 49

def received_events(user, options = {})
  paginate "#{User.path 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")

Parameters:

  • user (Integer, String)

    GitHub user login or id

Returns:

  • (Array<Sawyer::Resource>)

    A list of public user received events

See Also:



60
61
62
# File 'lib/octokit/client/events.rb', line 60

def received_public_events(user, options = {})
  paginate "#{User.path 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 (Integer, String, Repository, Hash)

    A GitHub repository

Returns:

  • (Array<Sawyer::Resource>)

    A list of events for a repository

See Also:



71
72
73
# File 'lib/octokit/client/events.rb', line 71

def repository_events(repo, options = {})
  paginate "#{Repository.path 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 (Integer, String, Repository, Hash)

    A GitHub repository

Returns:

  • (Array<Sawyer::Resource>)

    Array of all Issue Events for this Repository

See Also:



119
120
121
# File 'lib/octokit/client/events.rb', line 119

def repository_issue_events(repo, options = {})
  paginate "#{Repository.path 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:



82
83
84
# File 'lib/octokit/client/events.rb', line 82

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")

Parameters:

  • user (Integer, String)

    GitHub user login or id.

Returns:

  • (Array<Sawyer::Resource>)

    A list of all user events

See Also:



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

def user_events(user, options = {})
  paginate "#{User.path 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 (Integer, String)

    GitHub user login or id

Returns:

  • (Array<Sawyer::Resource>)

    A list of public user events

See Also:



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

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