module Roda::RodaPlugins::MultiRoute::RequestMethods

  1. lib/roda/plugins/multi_route.rb


Public Instance

  1. multi_route

Public Instance methods


Check if the first segment in the path matches any of the current named routes. If so, call that named route. If not, do nothing. If the named route does not handle the request, and a block is given, yield to the block.

[show source]
    # File lib/roda/plugins/multi_route.rb
141 def multi_route(namespace=nil)
142   on self.class.named_route_regexp(namespace) do |section|
143     res = route(section, namespace)
144     if defined?(yield)
145       yield
146     else
147       res
148     end
149   end
150 end