Module: GitHub::Client::Events

Included in:
GitHub::Client
Defined in:
lib/github_api_v3/client/events.rb

Overview

Contains methods for the Events API.

Instance Method Summary collapse

Instance Method Details

#eventsArray Also known as: public_events

List public events.

Examples:

GitHub.events

Returns:

  • (Array)

    Array of events.

See Also:



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

def events
  get '/events'
end

#organization_events(org) ⇒ Array

List public events for an organization.

Parameters:

  • org (String)

    Organization name.

Returns:

  • (Array)

    Array of events.

See Also:



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

def organization_events(org)
  get "/orgs/#{org}/events"
end

#public_received_events(username) ⇒ Array

List public events that a user has received.

Parameters:

  • username (String)

    Username for user to get events for.

Returns:

  • (Array)

    Array of events.

See Also:



75
76
77
# File 'lib/github_api_v3/client/events.rb', line 75

def public_received_events(username)
  get "/users/#{username}/received_events/public"
end

#public_user_events(username) ⇒ Array

List public events performed by a user.

Parameters:

  • username (String)

    Username for user to get events for.

Returns:

  • (Array)

    Array of events.

See Also:



93
94
95
# File 'lib/github_api_v3/client/events.rb', line 93

def public_user_events(username)
  get "/users/#{username}/events/public"
end

#received_events(username) ⇒ Array

List events that a user has received.

Parameters:

  • username (String)

    Username for user to get events for.

Returns:

  • (Array)

    Array of events.

See Also:



66
67
68
# File 'lib/github_api_v3/client/events.rb', line 66

def received_events(username)
  get "/users/#{username}/received_events"
end

#repo_events(owner, repo) ⇒ Array

List repository events.

Examples:

GitHub.repo_events('caseyscarborough','github')

Parameters:

  • owner (String)

    Owner username.

  • repo (String)

    The repository name.

Returns:

  • (Array)

    Array of events.

See Also:



28
29
30
# File 'lib/github_api_v3/client/events.rb', line 28

def repo_events(owner, repo)
  get "/repos/#{owner}/#{repo}/events"
end

#repo_issue_events(owner, repo) ⇒ Array

List issue events for a repository.

Parameters:

  • owner (String)

    Owner username.

  • repo (String)

    The repository name.

Returns:

  • (Array)

    Array of events.

See Also:



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

def repo_issue_events(owner, repo)
  get "/repos/#{owner}/#{repo}/issues/events"
end

#repo_network_events(owner, repo) ⇒ Array

List public events for a network of repositories.

Parameters:

  • owner (String)

    Owner username.

  • repo (String)

    The repository name.

Returns:

  • (Array)

    Array of events.

See Also:



48
49
50
# File 'lib/github_api_v3/client/events.rb', line 48

def repo_network_events(owner, repo)
  get "/networks/#{owner}/#{repo}/events"
end

#user_events(username) ⇒ Array

List events performed by a user.

Parameters:

  • username (String)

    Username for user to get events for.

Returns:

  • (Array)

    Array of events.

See Also:



84
85
86
# File 'lib/github_api_v3/client/events.rb', line 84

def user_events(username)
  get "/users/#{username}/events"
end

#user_organization_events(org) ⇒ Array

List events for an organization.

Requires authentication. Returns the user’s organization events.

Parameters:

  • org (String)

    Organization name.

Returns:

  • (Array)

    Array of events.

See Also:



104
105
106
# File 'lib/github_api_v3/client/events.rb', line 104

def user_organization_events(org)
  get "/users/#{login}/events/orgs/#{org}"
end