Creating documentation for Rulings Classes, and updated the respective classes to reflect that.

This commit is contained in:
Nanda Scott 2018-02-05 21:16:54 -05:00
parent 00e0e09fa9
commit 982276404e
5 changed files with 68 additions and 8 deletions

60
docs/Rulings_Classes.md Normal file
View File

@ -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')

View File

@ -1,7 +1,7 @@
from .rulings_object import RulingsObject from .rulings_object import RulingsObject
class Mtgo(RulingsObject): class Mtgo(RulingsObject):
def __init__(self, _id): def __init__(self, **kwargs):
self.id = _id self.id = kwargs.get('id')
self.url = 'cards/mtgo/{}/rulings'.format(self.id) self.url = 'cards/mtgo/{}/rulings'.format(self.id)
super(Mtgo, self).__init__(self.url) super(Mtgo, self).__init__(self.url)

View File

@ -1,7 +1,7 @@
from .rulings_object import RulingsObject from .rulings_object import RulingsObject
class Multiverse(RulingsObject): class Multiverse(RulingsObject):
def __init__(self, _id): def __init__(self, **kwargs):
self.id = str(_id) self.id = str(kwargs.get('id'))
self.url = 'cards/multiverse/{}/rulings'.format(self.id) self.url = 'cards/multiverse/{}/rulings'.format(self.id)
super(Multiverse, self).__init__(self.url) super(Multiverse, self).__init__(self.url)

View File

@ -1,7 +1,7 @@
from .rulings_object import RulingsObject from .rulings_object import RulingsObject
class Id(RulingsObject): class Id(RulingsObject):
def __init__(self, _id): def __init__(self, **kwargs):
self.id = str(_id) self.id = str(kwargs.get('id'))
self.url = 'cards/{}/rulings'.format(self.id) self.url = 'cards/{}/rulings'.format(self.id)
super(Id, self).__init__(self.url) super(Id, self).__init__(self.url)

View File

@ -1,8 +1,8 @@
from .rulings_object import RulingsObject from .rulings_object import RulingsObject
class Code(RulingsObject): class Code(RulingsObject):
def __init__(self, code, number): def __init__(self, code, collector_number):
self.code = code.lower() self.code = code.lower()
self.number = str(number) self.number = str(collector_number)
self.url = 'cards/{}/{}/rulings'.format(self.code, self.number) self.url = 'cards/{}/{}/rulings'.format(self.code, self.number)
super(Code, self).__init__(self.url) super(Code, self).__init__(self.url)