2018-01-31 01:47:31 +00:00
|
|
|
from .rulings_object import RulingsObject
|
2018-01-31 01:36:44 +00:00
|
|
|
|
|
|
|
class Id(RulingsObject):
|
2018-02-21 23:33:58 +00:00
|
|
|
"""
|
|
|
|
cards/:id/rulings
|
|
|
|
|
|
|
|
Gets the ruling of a card by the Scryfall Id.
|
|
|
|
|
2018-10-25 20:04:36 +00:00
|
|
|
Args:
|
|
|
|
id (string): The id of the card you want rulings for.
|
|
|
|
format (string, optional): Returns data in the specified method. Defaults to JSON.
|
|
|
|
face (string, optional):
|
|
|
|
If you're using the `image` format, this will specify if you want the front or back face.
|
|
|
|
version (string, optional):
|
|
|
|
If you're using the `image` format, this will specify if you want the small, normal, large, etc version of the image.
|
|
|
|
pretty (string, optional):
|
|
|
|
Returns a prettier version of the json object. Note that this may break functionality with Scrython.
|
2018-02-21 23:33:58 +00:00
|
|
|
|
2018-10-28 05:09:09 +00:00
|
|
|
Returns:
|
|
|
|
N/A
|
|
|
|
|
|
|
|
Raises:
|
|
|
|
N/A
|
|
|
|
|
|
|
|
Examples:
|
2018-10-28 05:48:20 +00:00
|
|
|
>>> rule = scrython.rulings.Id(id="5976c352-ac49-4e0d-a4c0-ec9b6b78db9c")
|
2018-02-21 23:33:58 +00:00
|
|
|
>>> rule.data_length()
|
|
|
|
"""
|
2018-02-06 02:16:54 +00:00
|
|
|
def __init__(self, **kwargs):
|
2018-02-13 21:55:32 +00:00
|
|
|
if kwargs.get('id') is None:
|
2018-02-14 02:02:48 +00:00
|
|
|
raise TypeError('No id provided to search by')
|
2018-02-13 21:55:32 +00:00
|
|
|
|
2018-02-15 20:13:39 +00:00
|
|
|
self.url = 'cards/{}/rulings?'.format(str(kwargs.get('id')))
|
2018-01-31 01:36:44 +00:00
|
|
|
super(Id, self).__init__(self.url)
|