module Roda::RodaPlugins::NotFound::InstanceMethods

Private Instance Methods

_route() click to toggle source

If routing returns a 404 response with an empty body, call the not_found handler.

Calls superclass method
# File lib/roda/plugins/not_found.rb, line 42
def _route
  result = super

  if result[0] == 404 && (v = result[2]).is_a?(Array) && v.empty?
    super{not_found}
  else
    result
  end
end
not_found() click to toggle source

Use an empty not_found_handler by default, so that loading the plugin without defining a not_found handler doesn’t break things.

# File lib/roda/plugins/not_found.rb, line 55
def not_found
end