class Roda::RodaPlugins::HashRoutes::DSL
def dispatch_from(namespace='', branch, &block)
namespace. If a block is given, call the block with the request before
Setup the given branch in the given namespace to dispatch to routes in this
def dispatch_from(namespace='', branch, &block) ns = @namespace if block meth_hash = @roda.opts[:hash_routes_methods] key = [:dispatch_from, namespace, branch].freeze meth = meth_hash[key] = @roda.define_roda_method(meth_hash[key] || "hash_routes_dispatch_from_#{namespace}_#{branch}", 1, &block) @roda.hash_branch(namespace, branch) do |r| send(meth, r) r.hash_routes(ns) end else @roda.hash_branch(namespace, branch) do |r| r.hash_routes(ns) end end end