method
requirements_anchored?
v8.1.1 -
Show latest stable
- Class:
ActionDispatch::Journey::Path::Pattern
requirements_anchored?()public
No documentation available.
# File actionpack/lib/action_dispatch/journey/path/pattern.rb, line 36
def requirements_anchored?
# each required param must not be surrounded by a literal, otherwise it isn't
# simple to chunk-match the url piecemeal
terminals = ast.terminals
terminals.each_with_index { |s, index|
next if index < 1
next if s.type == :DOT || s.type == :SLASH
back = terminals[index - 1]
fwd = terminals[index + 1]
# we also don't support this yet, constraints must be regexps
return false if s.symbol? && s.regexp.is_a?(Array)
return false if back.literal?
return false if !fwd.nil? && fwd.literal?
}
true
end