From 0d6595773f0bfdd5631c8dc580ba2bce0d142f74 Mon Sep 17 00:00:00 2001 From: Linus Oleander Date: Sun, 12 Dec 2021 04:17:43 +0100 Subject: [PATCH] clean up --- lib/remap/rule/map.rb | 24 ------------------------ lib/remap/rule/map/optional.rb | 11 ----------- 2 files changed, 35 deletions(-) diff --git a/lib/remap/rule/map.rb b/lib/remap/rule/map.rb index 2173d516..df25bdeb 100644 --- a/lib/remap/rule/map.rb +++ b/lib/remap/rule/map.rb @@ -209,30 +209,6 @@ def callback(state, &error) end end end - - # Catches :fatal and raises {Notice::Error} - # - # @param state [State] - # @param id (:fatal) [:fatal, :notice, :ignore] - # - # raise [Notice::Error] - def fatal(state, id: :fatal, &block) - raise catch(id, &block).traced(backtrace).exception - end - - # Catches :notice exceptions and repackages them as a state - # - # @param state [State] - # - # @return [State] - def notice(state, &block) - state.set(notice: catch(:notice, &block).traced(backtrace)).except(:value) - end - - # @abstract - def ignore(...) - raise NotImplementedError, "#{self.class}#ignore" - end end end end diff --git a/lib/remap/rule/map/optional.rb b/lib/remap/rule/map/optional.rb index 17185d0f..9859394b 100644 --- a/lib/remap/rule/map/optional.rb +++ b/lib/remap/rule/map/optional.rb @@ -39,17 +39,6 @@ def call(state, &error) rescue Notice::Ignore => e e.undefined(state) end - - private - - # Catches :ignore exceptions and re-package them as a state - # - # @param state [State] - # - # @return [State] - def ignore(state, &block) - state.set(notice: catch(:ignore, &block).traced(backtrace)).except(:value) - end end end end