class Mato::Rescue

Attributes

filter[R]
on_error[R]

Public Class Methods

new(filter, on_error:) click to toggle source
# File lib/mato/rescue.rb, line 8
def initialize(filter, on_error:)
  @filter = filter
  @on_error = on_error
end

Public Instance Methods

call(content) click to toggle source
# File lib/mato/rescue.rb, line 13
def call(content)
  filter.call(content)
rescue => e
  on_error.call(e)
  content
end