Figured out a syntax that will deprecate many methods

This commit is contained in:
Nanda Scott 2018-10-23 23:06:01 -04:00
parent bf8e97caf7
commit 2286ace24c
1 changed files with 8 additions and 1 deletions

View File

@ -53,9 +53,16 @@ class RulingsObject(FoundationObject):
return self.scryfallJson['has_more']
def data(self):
def data(self, index=None, key=None):
self._checkForKey('data')
if index is not None:
if key is not None:
self._checkForTupleKey('data', index, key)
return self.scryfallJson['data'][index][key]
return self.scryfallJson['data'][index]
return self.scryfallJson['data']
def data_length(self):