File tree 1 file changed +19
-11
lines changed
1 file changed +19
-11
lines changed Original file line number Diff line number Diff line change 6
6
7
7
8
8
class UserSearchResult (GitHubCore ):
9
- def _update_attributes (self , data ):
10
- result = data .copy ()
9
+ """Representation of a search result for a user.
10
+
11
+ This object has the following attributes:
12
+
13
+ .. attribute:: score
14
+
15
+ The confidence score of this result.
11
16
12
- #: Score of the result
13
- self .score = self ._get_attribute (result , 'score' )
14
- if 'score' in result :
15
- del result ['score' ]
17
+ .. attribute:: text_matches
16
18
17
- #: Text matches
18
- self .text_matches = self ._get_attribute (result , 'text_matches' , [])
19
- if 'text_matches' in result :
20
- del result ['text_matches' ]
19
+ If present, a list of text strings that match the search string.
21
20
22
- #: User object matching the search
21
+ .. attribute:: user
22
+
23
+ A :class:`~github3.users.ShortUser` representing the user found
24
+ in this search result.
25
+ """
26
+
27
+ def _update_attributes (self , data ):
28
+ result = data .copy ()
29
+ self .score = result .pop ('score' )
30
+ self .text_matches = result .pop ('text_matches' , [])
23
31
self .user = users .ShortUser (result , self )
24
32
25
33
def _repr (self ):
You can’t perform that action at this time.
0 commit comments