Update github3.search.user for consistency
@@ -6,20 +6,28 @@ from ..models import GitHubCore
class UserSearchResult(GitHubCore):
- def _update_attributes(self, data):
- result = data.copy()
+ """Representation of a search result for a user.
+
+ This object has the following attributes:
+
+ .. attribute:: score
+
+ The confidence score of this result.
- #: Score of the result
- self.score = self._get_attribute(result, 'score')
- if 'score' in result:
- del result['score']
+ .. attribute:: text_matches
- #: Text matches
- self.text_matches = self._get_attribute(result, 'text_matches', [])
- if 'text_matches' in result:
- del result['text_matches']
+ If present, a list of text strings that match the search string.
- #: User object matching the search
+ .. attribute:: user
+
+ A :class:`~github3.users.ShortUser` representing the user found
+ in this search result.
+ """
+
+ def _update_attributes(self, data):
+ result = data.copy()
+ self.score = result.pop('score')
+ self.text_matches = result.pop('text_matches', [])
self.user = users.ShortUser(result, self)
def _repr(self):
