mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-15 22:41:30 +00:00
first stepのネストを減らした
This commit is contained in:
parent
910360c631
commit
25c22bad50
@ -16,16 +16,14 @@ class GildedRose
|
||||
|
||||
def first_step(item)
|
||||
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)
|
||||
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
|
||||
else
|
||||
if item.quality > 0 && item.name != SULFURAS
|
||||
|
||||
Loading…
Reference in New Issue
Block a user