Module: Roda::RodaPlugins::MapMatcher
- Defined in:
- lib/roda/plugins/map_matcher.rb
Overview
The map_matcher plugin allows you to provide a string-keyed hash during route matching, and match any of the keys in the hash as the next segment in the request path, yielding the corresponding value in the hash:
class App < Roda
plugin :map_matcher
map = { "foo" => "bar", "baz" => "quux" }.freeze
route do
r.get map: map do |v|
v
# GET /foo => bar
# GET /baz => quux
end
end
end
Defined Under Namespace
Modules: RequestMethods