Skip to content

Commit 3386eb9

Browse files
authored
Merge pull request sigmavirus24#766 from sigmavirus24/implement-refresh-event-obj
Add refresh method to Event objects
2 parents a15fcf1 + ca50543 commit 3386eb9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

github3/events.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ def to_user(self):
3131
json = self._json(self._get(url), 200)
3232
return self._instance_or_null(users.User, json)
3333

34+
refresh = to_user
35+
3436

3537
class EventOrganization(GitHubCore):
3638
"""The class that represents the org information returned in Events."""
@@ -49,6 +51,8 @@ def to_org(self):
4951
json = self._json(self._get(url), 200)
5052
return self._instance_or_null(orgs.Organization, json)
5153

54+
refresh = to_org
55+
5256

5357
class EventPullRequest(GitHubCore):
5458
"""The class that represents the pr information returned in Events."""
@@ -67,6 +71,8 @@ def to_pull(self):
6771
json = self._json(self._get(self.url), 200)
6872
return self._instance_or_null(pulls.PullRequest, json)
6973

74+
refresh = to_pull
75+
7076

7177
class EventIssue(GitHubCore):
7278
"""The class that represents the issue information returned in Events."""
@@ -85,6 +91,8 @@ def to_issue(self):
8591
json = self._json(self._get(self.url), 200)
8692
return self._instance_or_null(issues.Issue, json)
8793

94+
refresh = to_issue
95+
8896

8997
class Event(GitHubCore):
9098

0 commit comments

Comments
 (0)