module Roda::RodaPlugins::HashPaths::ClassMethods

def freeze

Freeze the hash_paths metadata when freezing the app.
def freeze
  opts[:hash_paths].freeze.each_value(&:freeze)
  super
end

def hash_path(namespace='', path, &block)

path handler if it exists.
there is one. If called without a block, removes the existing
for the full remaining path, and dispatch to that block if
r.hash_paths method is called, checks the matching namespace
Add path handler for the given namespace and path. When the
def hash_path(namespace='', path, &block)
  routes = opts[:hash_paths][namespace] ||= {}
  if block
    routes[path] = define_roda_method(routes[path] || "hash_path_#{namespace}_#{path}", 1, &convert_route_block(block))
  elsif meth = routes.delete(path)
    remove_method(meth)
  end
end

def inherited(subclass)

Duplicate hash_paths metadata in subclass.
def inherited(subclass)
  super
  h = subclass.opts[:hash_paths]
  opts[:hash_paths].each do |namespace, routes|
    h[namespace] = routes.dup
  end
end