Added arena id endpoint
This commit is contained in:
parent
3a56295662
commit
a525ad5971
|
@ -7,6 +7,7 @@ from scrython.cards import Multiverse
|
|||
from scrython.cards import Named
|
||||
from scrython.cards import Random
|
||||
from scrython.cards import Search
|
||||
from scrython.cards import ArenaId
|
||||
|
||||
#Import classes from rulings
|
||||
from scrython.rulings import Mtgo
|
||||
|
|
|
@ -6,3 +6,4 @@ from .multiverse import Multiverse
|
|||
from .named import Named
|
||||
from .randomcard import Random
|
||||
from .search import Search
|
||||
from .arena_id import ArenaId
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
from .cards_object import CardsObject
|
||||
|
||||
class ArenaId(CardsObject):
|
||||
"""
|
||||
cards/id
|
||||
Get a card by the Arena id.
|
||||
|
||||
Positional arguments:
|
||||
id : str ....................... The Scryfall Id of the card.
|
||||
|
||||
Optional arguments:
|
||||
Inherits all arguments from CardsObject.
|
||||
|
||||
Attributes:
|
||||
All attributes are inherited from CardsObject.
|
||||
|
||||
Example usage:
|
||||
>>> card = scrython.cards.ArenaId(id="66975")
|
||||
>>> card.name()
|
||||
"""
|
||||
def __init__(self, **kwargs):
|
||||
if kwargs.get('id') is None:
|
||||
raise TypeError('No id provided to search by')
|
||||
|
||||
self.url = 'cards/arena/{}?'.format(str(kwargs.get('id')))
|
||||
super(ArenaId, self).__init__(self.url)
|
Loading…
Reference in New Issue