diff --git a/scrython/rulings/mtgo.py b/scrython/rulings/mtgo.py index ea256f5..f1f7310 100644 --- a/scrython/rulings/mtgo.py +++ b/scrython/rulings/mtgo.py @@ -1,6 +1,24 @@ from .rulings_object import RulingsObject class Mtgo(RulingsObject): + """ + cards/mtgo/:id/rulings + + Gets the ruling of a card by the Mtgo Id. + + Positional arguments: + id : str ................. The mtgo id of the card you want rulings for. + + Optional arguments: + All arguments inherited from RulingsObject + + Attributes: + All attributes inherited from RulingsObject + + Example usage: + >>> rule = scrython.rulings.Mtgo(id='9611') + >>> rule.data_length() + """ def __init__(self, **kwargs): if kwargs.get('id') is None: raise TypeError('No id provided to search by') diff --git a/scrython/rulings/multiverse_id.py b/scrython/rulings/multiverse_id.py index 9dd3b89..ceea643 100644 --- a/scrython/rulings/multiverse_id.py +++ b/scrython/rulings/multiverse_id.py @@ -1,6 +1,24 @@ from .rulings_object import RulingsObject class Multiverse(RulingsObject): + """ + cards/multiverse/:id/rulings + + Gets the ruling of a card by the Multiverse Id. + + Positional arguments: + id : str ........... The multiverse id of the card you want rulings for. + + Optional arguments: + All arguments inherited from RulingsObject + + Attributes: + All attributes inherited from RulingsObject + + Example usage: + >>> rule = scrython.rulings.Id(id='4301') + >>> rule.data_length() + """ def __init__(self, **kwargs): if kwargs.get('id') is None: raise TypeError('No id provided to search by') diff --git a/scrython/rulings/rulings_object.py b/scrython/rulings/rulings_object.py index 38a027d..2fc0e2f 100644 --- a/scrython/rulings/rulings_object.py +++ b/scrython/rulings/rulings_object.py @@ -3,6 +3,33 @@ import aiohttp import urllib.parse class RulingsObject(object): + """ + Master class for all rulings objects. + + Positional arguments: + No arguments required. + + Optional arguments: + format : str ... Returns data in the specified method. Defaults to JSON. + face : str ... If you're using the `image` format, this will specify if + you want the front or back face. + version : str ... If you're using the `image` format, this will specify if + you want the small, normal, large, etc version of the image. + pretty : str ... Returns a prettier version of the json object. Note that + this may break functionality with Scrython. + + Attributes: + object : str ...... Returns the type of object it is. (card, error, etc) + had_more : bool ... If true, this ruling object has more rules than it currently displays. + data : list .................................. A list of ruling objects. + data_length : int ....................... The length of the `data` list. + + The following require an integer as an arg, which acts as a tuple. + ruling_object : str ............. The type of object for a given ruling. + ruling_source : str .......................... The source of the ruling. + ruling_published_at : str ...... The date when the ruling was published. + ruling_comment : str ............................. The effective ruling. + """ def __init__(self, _url, **kwargs): self.params = { 'format': kwargs.get('format', 'json'), 'face': kwargs.get('face', ''), diff --git a/scrython/rulings/scryfall_id.py b/scrython/rulings/scryfall_id.py index 8fbf4f3..457adcd 100644 --- a/scrython/rulings/scryfall_id.py +++ b/scrython/rulings/scryfall_id.py @@ -1,6 +1,24 @@ from .rulings_object import RulingsObject class Id(RulingsObject): + """ + cards/:id/rulings + + Gets the ruling of a card by the Scryfall Id. + + Positional arguments: + id : str ...................... The id of the card you want rulings for. + + Optional arguments: + All arguments inherited from RulingsObject + + Attributes: + All attributes inherited from RulingsObject + + Example usage: + >>> rule = scrython.rulings.Id(id='5976c352-ac49-4e0d-a4c0-ec9b6b78db9c') + >>> rule.data_length() + """ def __init__(self, **kwargs): if kwargs.get('id') is None: raise TypeError('No id provided to search by') diff --git a/scrython/rulings/set_code.py b/scrython/rulings/set_code.py index d38a1f8..433352e 100644 --- a/scrython/rulings/set_code.py +++ b/scrython/rulings/set_code.py @@ -1,6 +1,25 @@ from .rulings_object import RulingsObject class Code(RulingsObject): + """ + cards/:code/:collector_number/rulings + + Gets the ruling of a card by the set and collector number. + + Positional arguments: + set : str ...... The 3 letter set code of the card you want rulings for. + collector_number : ................... The collector number of the card. + + Optional arguments: + All arguments inherited from RulingsObject + + Attributes: + All attributes inherited from RulingsObject + + Example usage: + >>> rule = scrython.rulings.Code(code='ddg', collector_number='42') + >>> rule.data_length() + """ def __init__(self, code, collector_number): self.url = 'cards/{}/{}/rulings?'.format(code.lower(), str(collector_number)) super(Code, self).__init__(self.url)