mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 14:31:28 +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"
|
item.name == "Aged Brie"
|
||||||
end
|
end
|
||||||
|
|
||||||
def update_quality()
|
def update_item_quality(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
|
||||||
decrease_quality(item)
|
decrease_quality(item)
|
||||||
@ -45,6 +44,11 @@ class GildedRose
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def update_quality()
|
||||||
|
@items.each do |item|
|
||||||
|
update_item_quality(item)
|
||||||
if !legendary?(item)
|
if !legendary?(item)
|
||||||
item.sell_in = item.sell_in - 1
|
item.sell_in = item.sell_in - 1
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user