mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-18 16:01:42 +00:00
first stepのネストを減らした
This commit is contained in:
parent
910360c631
commit
25c22bad50
@ -16,16 +16,14 @@ class GildedRose
|
|||||||
|
|
||||||
def first_step(item)
|
def first_step(item)
|
||||||
if item.name == AGED_BRIE || item.name == BACKSTAGE_PASS
|
if item.name == AGED_BRIE || item.name == BACKSTAGE_PASS
|
||||||
if item.quality < 50
|
return unless item.quality < 50
|
||||||
|
increment_item_quality(item)
|
||||||
|
return if item.name == AGED_BRIE
|
||||||
|
if item.sell_in < 11 && item.quality < 50
|
||||||
|
increment_item_quality(item)
|
||||||
|
end
|
||||||
|
if item.sell_in < 6 && item.quality < 50
|
||||||
increment_item_quality(item)
|
increment_item_quality(item)
|
||||||
if item.name == BACKSTAGE_PASS
|
|
||||||
if item.sell_in < 11 && item.quality < 50
|
|
||||||
increment_item_quality(item)
|
|
||||||
end
|
|
||||||
if item.sell_in < 6 && item.quality < 50
|
|
||||||
increment_item_quality(item)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if item.quality > 0 && item.name != SULFURAS
|
if item.quality > 0 && item.name != SULFURAS
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user