Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
oleander committed Dec 12, 2021
1 parent 1048dda commit 0d65957
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
24 changes: 0 additions & 24 deletions lib/remap/rule/map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 0 additions & 11 deletions lib/remap/rule/map/optional.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0d65957

Please sign in to comment.