lib/roda/plugins/named_routes.rb
# If the given route has a name, treat it as a named route and
# store the route block.  Otherwise, this is the main route, so
# call super.
If the given route has a name, treat it as a named route and
store the route block.  Otherwise, this is the main route, so
call super.
If the given route has a name treat it as a named route and store the route block . Otherwise this is the main route so call super .
def route(name=nil, namespace=nil, &block)
          if name
            routes = opts[:namespaced_routes][namespace] ||= {}
            if block
              routes[name] = define_roda_method(routes[name] || "named_routes_#{namespace}_#{name}", 1, &convert_route_block(block))
            elsif meth = routes[name]
              routes.delete(name)
              remove_method(meth)
            end
          else
            super(&block)
          end
        end
def route ( name = nil , namespace = nil , & block ) if name routes = opts [ :namespaced_routes ] [ namespace ] ||= { } if block routes [ name ] = define_roda_method ( routes [ name ] || "named_routes_#{namespace}_#{name}" , 1 , & convert_route_block ( block ) ) elsif meth = routes [ name ] routes . delete ( name ) remove_method ( meth ) end else super ( & block ) end end
If the given route has a name, treat it as a named route and
store the route block.
If the given route has a name treat it as a named route and store the route block .
name
namespace
block