mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-28 04:41:14 +00:00
<long method>: crear metodo para actualizar calidad de item
This commit is contained in:
parent
1dbf58aca7
commit
a697fad530
@ -26,8 +26,7 @@ class GildedRose
|
||||
item.name == "Aged Brie"
|
||||
end
|
||||
|
||||
def update_quality()
|
||||
@items.each do |item|
|
||||
def update_item_quality(item)
|
||||
if !aged_brie?(item) and !backstage_pass?(item)
|
||||
if item.quality > 0
|
||||
decrease_quality(item)
|
||||
@ -45,6 +44,11 @@ class GildedRose
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def update_quality()
|
||||
@items.each do |item|
|
||||
update_item_quality(item)
|
||||
if !legendary?(item)
|
||||
item.sell_in = item.sell_in - 1
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user