mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 11:21:16 +00:00
Add a way to create an object from raw data (Issue #144)
This commit is contained in:
@@ -278,3 +278,12 @@ class Github(object):
|
||||
None
|
||||
)
|
||||
return GitignoreTemplate.GitignoreTemplate(self.__requester, attributes, completed=True)
|
||||
|
||||
def create_from_raw_data(self, klass, raw_data):
|
||||
"""
|
||||
Creates an object from raw_data previously obtained by myObject.raw_data
|
||||
:param klass: the class of the object to create
|
||||
:param raw_data: dict
|
||||
:rtype: instance of class ``klass``
|
||||
"""
|
||||
return klass(self.__requester, raw_data, completed=True)
|
||||
|
||||
Reference in New Issue
Block a user