module Roda::RodaPlugins::StaticRouting::ClassMethods
def add_static_route(method, path, &block)
def add_static_route(method, path, &block) (opts[:static_routes][path] ||= {})[method] = block end
def freeze
def freeze opts[:static_routes].freeze.each_value(&:freeze) super end
def inherited(subclass)
def inherited(subclass) super static_routes = subclass.opts[:static_routes] opts[:static_routes].each do |k, v| static_routes[k] = v.dup end end
def static_route(path, &block)
methods inside the route for handling shared behavior while
static_get), but allow you to use Roda's routing tree
tried after the request method specific static routes (e.g.
Add a static route for any request method. These are
def static_route(path, &block) add_static_route(nil, path, &block) end
def static_route_for(method, path)
def static_route_for(method, path) if h = opts[:static_routes][path] h[method] || h[nil] end end