def call(env)
      route = @routes.map do |exp, meta|
        next unless matches = env["PATH_INFO"].match(exp)
        meta.merge(captures: matches)
      end.compact.first

      return Yokunai::ErrorsController.new(env).not_found unless route

      request_method = env["REQUEST_METHOD"]
      if route[:methods].include?(request_method)
        Object.const_get(route[:class])
          .new(env, route[:captures])
          .public_send(request_method.downcase)
      else
        Yokunai::ErrorsController.new(env).unsupported_method
      end
    end
def call(env)
      route = @routes.map do |exp, meta|
        next unless matches = env["PATH_INFO"].match(exp)
        meta.merge(captures: matches)
      end.compact.first

      return Yokunai::ErrorsController.new(env).not_found unless route

      request_method = env["REQUEST_METHOD"]
      if route[:methods].include?(request_method)
        Object.const_get(route[:class])
          .new(env, route[:captures])
          .public_send(request_method.downcase)
      else
        Yokunai::ErrorsController.new(env).unsupported_method
      end
    end
@param route_map [Hash] A hash with path regexes as keys, and hashes as values with the controller to send matching requests to.
 @param base_dir [String] The absolute base directory to use for various lookups.
 @param hooks [Array] An optional list of classes which will have their class-level `run` method called when the app boots.
 Route a request to the correct controller based on the given data.

 @param env [Rack::Env] the full Rack environment
 @return [Array] a Rack-compatible response array.