lib/roda/plugins/hash_routes.rb
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
# Setup the given branch in the given namespace to dispatch to routes in this
# namespace.  If a block is given, call the block with the request before
# dispatching to routes in this namespace.
Setup the given branch in the given namespace to dispatch to routes in this
namespace.  If a block is given, call the block with the request before
dispatching to routes in this namespace.
Setup the given branch in the given namespace to dispatch to routes in this namespace . If a block is given call the block with the request before dispatching to routes in this namespace .
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
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
Setup the given branch in the given namespace to dispatch to routes in this
namespace.
Setup the given branch in the given namespace to dispatch to routes in this namespace .
namespace
branch
block