Extract method to update the item quality

This commit is contained in:
shanmukhanath 2022-06-12 14:16:22 +05:30
parent b57ae7007d
commit 37f400d4b1

View File

@ -7,6 +7,9 @@ class GildedRose(object):
def update_quality(self): def update_quality(self):
for item in self.items: for item in self.items:
self.update_item_quality(item)
def update_item_quality(self, item):
if item.name != "Aged Brie" and item.name != "Backstage passes to a TAFKAL80ETC concert": if item.name != "Aged Brie" and item.name != "Backstage passes to a TAFKAL80ETC concert":
if item.quality > 0: if item.quality > 0:
if item.name != "Sulfuras, Hand of Ragnaros": if item.name != "Sulfuras, Hand of Ragnaros":