method
normalize_requirements!
v4.1.8 -
Show latest stable
- Class:
ActionDispatch::Routing::Mapper::Mapping
normalize_requirements!()private
No documentation available.
# File actionpack/lib/action_dispatch/routing/mapper.rb, line 120
def normalize_requirements!
constraints.each do |key, requirement|
next unless segment_keys.include?(key) || key == :controller
verify_regexp_requirement(requirement) if requirement.is_a?(Regexp)
@requirements[key] = requirement
end
if options[:format] == true
@requirements[:format] ||= /.+/
elsif Regexp === options[:format]
@requirements[:format] = options[:format]
elsif String === options[:format]
@requirements[:format] = Regexp.compile(options[:format])
end
end