diff --git a/docs/Rulings_Classes.md b/docs/Rulings_Classes.md new file mode 100644 index 0000000..a6faf9f --- /dev/null +++ b/docs/Rulings_Classes.md @@ -0,0 +1,60 @@ +# Rulings Classes + +## `rulings.Id()` +Gets the ruling of a card by the Scryfall Id. + +**Parameters:** + +| Param |Required [y/n]| Input type | Description | +| :---: | :---: | :---: |:---: | +|id|Yes|String|The id of the card you want rulings for.| + +**Attributes:** +The same listed in the `rulings` documentation. + +Example usage: + rule = scrython.rulings.Id(id='31412335-110c-449a-9c2f-bff8763a6504') + +## `rulings.Mtgo()` +Gets the ruling of a card by the Mtgo Id. + +**Parameters:** + +|Param|Required [y/n]|Input type|Description| +|:---:|:---:|:---:|:---:| +|id|Yes|String|The Mtgo id of the card you want rulings for.| + +**Attributes:** +The same listed in the `rulings` documentation. + +Example usage: + rule = scrython.rulings.Mtgo(id="24811") + +## `rulings.Multiverse()` +Gets the ruling of a card by the Multiverse Id. + +**Parameters:** +|Param|Required [y/n]|Input type|Description| +|:---:|:---:|:---:|:---:| +|id|Yes|String|The Multiverse Id of the card you want rulings for.| + +**Attributes:** +The same listed in the `rulings` documentation. + +Example usage: + rule = scrython.rulings.Multiverse(id="124451") + +## `rulings.Code()` +Gets the ruling of a card by the set code and collector number. + +**Parameters:** +|Param|Required [y/n]|Input type|Description| +|:---:|:---:|:---:|:---:| +|code|Yes|String|The 3 letter set code of the card.| +|collector_number|Yes|String|The collector number of the card.| + +**Attributes:** +The same listed in the `rulings` documentation. + +Example usage: + rule = scrython.rulings.Code(code='CSP', collector_number='142') diff --git a/rulings/mtgo.py b/rulings/mtgo.py index b0ab7ed..5a17dd9 100644 --- a/rulings/mtgo.py +++ b/rulings/mtgo.py @@ -1,7 +1,7 @@ from .rulings_object import RulingsObject class Mtgo(RulingsObject): - def __init__(self, _id): - self.id = _id + def __init__(self, **kwargs): + self.id = kwargs.get('id') self.url = 'cards/mtgo/{}/rulings'.format(self.id) super(Mtgo, self).__init__(self.url) diff --git a/rulings/multiverse_id.py b/rulings/multiverse_id.py index b290c4f..e92c43b 100644 --- a/rulings/multiverse_id.py +++ b/rulings/multiverse_id.py @@ -1,7 +1,7 @@ from .rulings_object import RulingsObject class Multiverse(RulingsObject): - def __init__(self, _id): - self.id = str(_id) + def __init__(self, **kwargs): + self.id = str(kwargs.get('id')) self.url = 'cards/multiverse/{}/rulings'.format(self.id) super(Multiverse, self).__init__(self.url) diff --git a/rulings/scryfall_id.py b/rulings/scryfall_id.py index 04757de..416ae7e 100644 --- a/rulings/scryfall_id.py +++ b/rulings/scryfall_id.py @@ -1,7 +1,7 @@ from .rulings_object import RulingsObject class Id(RulingsObject): - def __init__(self, _id): - self.id = str(_id) + def __init__(self, **kwargs): + self.id = str(kwargs.get('id')) self.url = 'cards/{}/rulings'.format(self.id) super(Id, self).__init__(self.url) diff --git a/rulings/set_code.py b/rulings/set_code.py index 08994b0..943352e 100644 --- a/rulings/set_code.py +++ b/rulings/set_code.py @@ -1,8 +1,8 @@ from .rulings_object import RulingsObject class Code(RulingsObject): - def __init__(self, code, number): + def __init__(self, code, collector_number): self.code = code.lower() - self.number = str(number) + self.number = str(collector_number) self.url = 'cards/{}/{}/rulings'.format(self.code, self.number) super(Code, self).__init__(self.url)