From 299a7efb12c41dcd1f7939910588471c9a2f68c6 Mon Sep 17 00:00:00 2001 From: davidraj Date: Mon, 10 Oct 2022 19:08:41 +0100 Subject: [PATCH] Composition of never sold method --- ruby/item_processor.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ruby/item_processor.rb b/ruby/item_processor.rb index 4e45cd9a..d21f3cb6 100644 --- a/ruby/item_processor.rb +++ b/ruby/item_processor.rb @@ -8,6 +8,8 @@ class ItemProcessor end def update_item_quality + return if never_sold + if (item.name != 'Aged Brie') && (item.name != 'Backstage passes to a TAFKAL80ETC concert') decrease_item_quality else @@ -44,4 +46,8 @@ class ItemProcessor def old_item item.sell_in = item.sell_in - 1 if item.name != 'Sulfuras, Hand of Ragnaros' end + + def never_sold + item.name == 'Sulfuras, Hand of Ragnaros' + end end