module Roda::RodaPlugins::Base::RequestMethods
def is(*args, &block)
end
# matches as path is empty after matching
r.is "" do
r.on 'foo/bar' do
end
# matches as path is empty after matching
r.is 'foo/bar/' do
end
# does not match, as path isn't fully matched (/ remaining)
r.is 'foo/bar' do
# => "/foo/bar/"
r.remaining_path
is empty, not if it still contains a trailing slash:
Note that this matches only if the path after matching the arguments
end
end
# matches as path is already empty
r.is do
r.on 'foo/bar' do
If no arguments are given, matches if the path is already fully matched.
end
# matches as path is empty after matching
r.is 'foo/bar' do
end
# does not match, as path isn't fully matched (/bar remaining)
r.is 'foo' do
# => "/foo/bar"
r.remaining_path
returned.
executed, and when the match block returns, the rack response is
have fully matched the path. If it matches, the match block is
Does a terminal match on the current path, matching only if the arguments
def is(*args, &block) if args.empty? if empty_path? always(&block) end else args << TERM if_match(args, &block) end end