mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-04 17:21:38 +00:00
<duplicate code> agregar metodo para aged brie
This commit is contained in:
parent
013f3aa57b
commit
89997aa956
@ -20,9 +20,13 @@ class GildedRose
|
||||
item.quality = item.quality + 1
|
||||
end
|
||||
|
||||
def aged_brie?(item)
|
||||
item.name == "Aged Brie"
|
||||
end
|
||||
|
||||
def update_quality()
|
||||
@items.each do |item|
|
||||
if item.name != "Aged Brie" and !backstage_pass?(item)
|
||||
if !aged_brie?(item) and !backstage_pass?(item)
|
||||
if item.quality > 0
|
||||
if not_legendary?(item)
|
||||
decrease_quality(item)
|
||||
@ -45,7 +49,7 @@ class GildedRose
|
||||
item.sell_in = item.sell_in - 1
|
||||
end
|
||||
if item.sell_in < 0
|
||||
if item.name != "Aged Brie"
|
||||
if !aged_brie?(item)
|
||||
if !backstage_pass?(item)
|
||||
if item.quality > 0
|
||||
if not_legendary?(item)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user