Add a way to create an object from raw data (Issue #144)

This commit is contained in:
Vincent Jacques
2013-03-14 12:32:46 +01:00
parent fa43e95268
commit 3af543a1fe
2 changed files with 16 additions and 0 deletions
+9
View File
@@ -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)