module Roda::RodaPlugins::ClassLevelRouting::InstanceMethods
def _roda_after_10__class_level_routing(result)
If the normal routing tree doesn't handle an action, try each class level route
def _roda_after_10__class_level_routing(result) if result && result[0] == 404 && (v = result[2]).is_a?(Array) && v.empty? # Reset the response so it doesn't inherit the status or any headers from # the original response. @_response.send(:initialize) @_response.status = nil result.replace(_roda_handle_route do r = @_request opts[:class_level_routes].each do |request_meth, args, meth| r.instance_variable_set(:@remaining_path, @_original_remaining_path) r.public_send(request_meth, *args) do |*a| send(meth, *a) end end nil end) end end