mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 22:41:30 +00:00
composed method - old item
This commit is contained in:
parent
8a5ad5ca19
commit
5f137d6312
@ -19,7 +19,7 @@ class ItemProcessor
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
item.sell_in = item.sell_in - 1 if item.name != 'Sulfuras, Hand of Ragnaros'
|
old_item
|
||||||
if item.sell_in < 0
|
if item.sell_in < 0
|
||||||
if item.name != 'Aged Brie'
|
if item.name != 'Aged Brie'
|
||||||
if item.name != 'Backstage passes to a TAFKAL80ETC concert'
|
if item.name != 'Backstage passes to a TAFKAL80ETC concert'
|
||||||
@ -40,4 +40,8 @@ class ItemProcessor
|
|||||||
def decrease_item_quality
|
def decrease_item_quality
|
||||||
item.quality -= 1 if item.quality > 0 && item.name != 'Sulfuras, Hand of Ragnaros'
|
item.quality -= 1 if item.quality > 0 && item.name != 'Sulfuras, Hand of Ragnaros'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def old_item
|
||||||
|
item.sell_in = item.sell_in - 1 if item.name != 'Sulfuras, Hand of Ragnaros'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user