mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 14:31:28 +00:00
refactor backstage path to use regex, this allows other backstage items to work provided backstage is in their name
This commit is contained in:
parent
c940184607
commit
2b410aa50b
@ -15,7 +15,7 @@ class GildedRose
|
||||
else
|
||||
if item.quality < 50
|
||||
item.quality = item.quality + 1
|
||||
if item.name == "Backstage passes to a TAFKAL80ETC concert"
|
||||
if item.name.downcase.match /backstage/
|
||||
if item.sell_in < 11
|
||||
if item.quality < 50
|
||||
item.quality = item.quality + 1
|
||||
@ -34,7 +34,7 @@ class GildedRose
|
||||
end
|
||||
if item.sell_in < 0
|
||||
if item.name != "Aged Brie"
|
||||
if item.name != "Backstage passes to a TAFKAL80ETC concert"
|
||||
if !item.name.downcase.match /backstage/
|
||||
if item.quality > 0
|
||||
if item.name != "Sulfuras, Hand of Ragnaros"
|
||||
item.quality = item.quality - 1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user