mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 14:31:28 +00:00
Extract _updateSellIn
This commit is contained in:
parent
cde87568f5
commit
bb67302d3a
@ -33,9 +33,7 @@ class Shop {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.name != 'Sulfuras, Hand of Ragnaros') {
|
||||
item.sellIn = item.sellIn - 1;
|
||||
}
|
||||
this._updateSellIn(item)
|
||||
if (item.sellIn < 0) {
|
||||
if (item.name != 'Aged Brie') {
|
||||
if (item.name != 'Backstage passes to a TAFKAL80ETC concert') {
|
||||
@ -54,6 +52,12 @@ class Shop {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_updateSellIn(item) {
|
||||
if (item.name != 'Sulfuras, Hand of Ragnaros') {
|
||||
item.sellIn = item.sellIn - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
module.exports = {
|
||||
Shop
|
||||
|
||||
Loading…
Reference in New Issue
Block a user