mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-18 07:51:29 +00:00
Composition of never sold method
This commit is contained in:
parent
5f137d6312
commit
299a7efb12
@ -8,6 +8,8 @@ class ItemProcessor
|
|||||||
end
|
end
|
||||||
|
|
||||||
def update_item_quality
|
def update_item_quality
|
||||||
|
return if never_sold
|
||||||
|
|
||||||
if (item.name != 'Aged Brie') && (item.name != 'Backstage passes to a TAFKAL80ETC concert')
|
if (item.name != 'Aged Brie') && (item.name != 'Backstage passes to a TAFKAL80ETC concert')
|
||||||
decrease_item_quality
|
decrease_item_quality
|
||||||
else
|
else
|
||||||
@ -44,4 +46,8 @@ class ItemProcessor
|
|||||||
def old_item
|
def old_item
|
||||||
item.sell_in = item.sell_in - 1 if item.name != 'Sulfuras, Hand of Ragnaros'
|
item.sell_in = item.sell_in - 1 if item.name != 'Sulfuras, Hand of Ragnaros'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def never_sold
|
||||||
|
item.name == 'Sulfuras, Hand of Ragnaros'
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user