Class: Events

Inherits:
Object
  • Object
show all
Defined in:
lib/github/events/events.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(github) ⇒ Events

Returns a new instance of Events.



4
5
6
# File 'lib/github/events/events.rb', line 4

def initialize(github)
  @github = github
end

Instance Attribute Details

#githubObject

Returns the value of attribute github.



2
3
4
# File 'lib/github/events/events.rb', line 2

def github
  @github
end

Instance Method Details

#listEventsObject



8
9
10
# File 'lib/github/events/events.rb', line 8

def listEvents()
  @github.get('events')
end

#listOrgEvents(org) ⇒ Object



41
42
43
44
# File 'lib/github/events/events.rb', line 41

def listOrgEvents(org)
  username = @github.username
  @github.get('users/%s/events/orgs/%s' % [username, org])
end

#listOrgPublicEvents(org) ⇒ Object



22
23
24
# File 'lib/github/events/events.rb', line 22

def listOrgPublicEvents(org)
  @github.get('orgs/%s/events' % org)
end

#listReceivedEvents(user = nil) ⇒ Object



31
32
33
34
# File 'lib/github/events/events.rb', line 31

def listReceivedEvents(user=nil)
  username = user == nil ? @github.username : user
  @github.get('users/%s/received_events' % username)
end

#listReceivedPublicEvents(user = nil) ⇒ Object



36
37
38
39
# File 'lib/github/events/events.rb', line 36

def listReceivedPublicEvents(user=nil)
  username = user == nil ? @github.username : user
  @github.get('users/%s/received_events/public' % username)
end

#listRepoEvents(repo, user = nil) ⇒ Object



12
13
14
15
# File 'lib/github/events/events.rb', line 12

def listRepoEvents(repo, user=nil)
  username = user == nil ? @github.username : user
  @github.get('repos/%s/%s/events' % [username, repo])
end

#listRepoIssueEvents(repo, user = nil) ⇒ Object



26
27
28
29
# File 'lib/github/events/events.rb', line 26

def listRepoIssueEvents(repo, user=nil)
  username = user == nil ? @github.username : user
  @github.get('repos/%s/%s/issues/events' % [username, repo])
end

#listRepoNetworkPublicEvents(repo, user = nil) ⇒ Object



17
18
19
20
# File 'lib/github/events/events.rb', line 17

def listRepoNetworkPublicEvents(repo, user=nil)
  username = user == nil ? @github.username : user
  @github.get('network/%s/%s/events' % [username, repo])
end