@@ -31,34 +31,34 @@ class Authorization(GitHubCore):
31
31
"""
32
32
33
33
def _update_attributes (self , auth ):
34
- self ._api = self . _get_attribute ( auth , 'url' )
34
+ self ._api = auth [ 'url' ]
35
35
36
36
#: Details about the application (name, url)
37
- self .app = self . _get_attribute ( auth , 'app' , {})
37
+ self .app = auth [ 'app' ]
38
38
39
39
#: Returns the Authorization token
40
- self .token = self . _get_attribute ( auth , 'token' )
40
+ self .token = auth [ 'token' ]
41
41
42
42
#: App name
43
- self .name = self ._get_attribute ( self . app , 'name' )
43
+ self .name = self .app [ 'name' ]
44
44
45
45
#: URL about the note
46
- self .note_url = self . _get_attribute ( auth , 'note_url' )
46
+ self .note_url = auth [ 'note_url' ]
47
47
48
48
#: Note about the authorization
49
- self .note = self . _get_attribute ( auth , 'note' )
49
+ self .note = auth [ 'note' ]
50
50
51
51
#: List of scopes this applies to
52
- self .scopes = self . _get_attribute ( auth , 'scopes' )
52
+ self .scopes = auth [ 'scopes' ]
53
53
54
54
#: Unique id of the authorization
55
- self .id = self . _get_attribute ( auth , 'id' )
55
+ self .id = auth [ 'id' ]
56
56
57
57
#: datetime object representing when the authorization was created.
58
- self .created_at = self ._strptime_attribute (auth , 'created_at' )
58
+ self .created_at = self ._strptime (auth [ 'created_at' ] )
59
59
60
60
#: datetime object representing when the authorization was updated.
61
- self .updated_at = self ._strptime_attribute (auth , 'updated_at' )
61
+ self .updated_at = self ._strptime (auth [ 'updated_at' ] )
62
62
63
63
def _repr (self ):
64
64
return '<Authorization [{0}]>' .format (self .name )
0 commit comments