From 810871fd777895856de87d929dcd37700428b13f Mon Sep 17 00:00:00 2001 From: Nanda Scott Date: Mon, 22 Oct 2018 11:24:15 -0400 Subject: [PATCH] Added arena endpoint to rulings --- scrython/rulings/arena.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 scrython/rulings/arena.py diff --git a/scrython/rulings/arena.py b/scrython/rulings/arena.py new file mode 100644 index 0000000..ef7d280 --- /dev/null +++ b/scrython/rulings/arena.py @@ -0,0 +1,27 @@ +from .rulings_object import RulingsObject + +class Arena(RulingsObject): + """ + cards/mtgo/:id/rulings + + Gets the ruling of a card by the Arena Id. + + Positional arguments: + id : str ................. The arena 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.Arena(id='66975') + >>> rule.data_length() + """ + def __init__(self, **kwargs): + if kwargs.get('id') is None: + raise TypeError('No id provided to search by') + + self.url = 'cards/arena/{}/rulings?'.format(str(kwargs.get('id'))) + super(Arena, self).__init__(self.url)