Module: Rack::Lint::Assertion

Defined in:
lib/rack/lint.rb

Instance Method Summary collapse

Instance Method Details

#assert(message) ⇒ Object


19
20
21
22
23
24
25
# File 'lib/rack/lint.rb', line 19

def assert(message)
  warn("Rack::Lint::Assertion#assert is deprecated as it is inherently inefficient. " \
    "Use `raise Rack::Lint::LintError, 'msg' unless condition` instead", uplevel: 1)
  unless yield
    raise LintError, message
  end
end