<negated query> cambiar query de no legendario por legendario

y negar donde se buscaba no legendario
This commit is contained in:
Felipe Gaete 2024-08-18 23:47:25 -04:00
parent 89997aa956
commit 8bfef25215

View File

@ -4,8 +4,8 @@ class GildedRose
@items = items @items = items
end end
def not_legendary?(item) def legendary?(item)
item.name != "Sulfuras, Hand of Ragnaros" item.name == "Sulfuras, Hand of Ragnaros"
end end
def backstage_pass?(item) def backstage_pass?(item)
@ -28,7 +28,7 @@ class GildedRose
@items.each do |item| @items.each do |item|
if !aged_brie?(item) and !backstage_pass?(item) if !aged_brie?(item) and !backstage_pass?(item)
if item.quality > 0 if item.quality > 0
if not_legendary?(item) if !legendary?(item)
decrease_quality(item) decrease_quality(item)
end end
end end
@ -45,14 +45,14 @@ class GildedRose
end end
end end
end end
if not_legendary?(item) if !legendary?(item)
item.sell_in = item.sell_in - 1 item.sell_in = item.sell_in - 1
end end
if item.sell_in < 0 if item.sell_in < 0
if !aged_brie?(item) if !aged_brie?(item)
if !backstage_pass?(item) if !backstage_pass?(item)
if item.quality > 0 if item.quality > 0
if not_legendary?(item) if !legendary?(item)
decrease_quality(item) decrease_quality(item)
end end
end end