Make an instance of an Item from raw item data. :param item_data: Item data to make an item from :return: Instance of the Item. :rtype: Item
(self, item_data)
| 251 | STATIC_DATA_FILE = os.path.join(_base_dir, 'data', 'items.json') |
| 252 | |
| 253 | def parse(self, item_data): |
| 254 | """ |
| 255 | Make an instance of an Item from raw item data. |
| 256 | :param item_data: Item data to make an item from |
| 257 | :return: Instance of the Item. |
| 258 | :rtype: Item |
| 259 | """ |
| 260 | item_id = item_data.get(Items.ID_FIELD, None) |
| 261 | item_count = item_data['count'] if 'count' in item_data else 0 |
| 262 | return Item(item_id, item_count) |
| 263 | |
| 264 | def all(self): |
| 265 | """ |
no test coverage detected