Method: ActionDispatch::Journey::Route#score
- Defined in:
- actionpack/lib/action_dispatch/journey/route.rb
#score(supplied_keys) ⇒ Object
109 110 111 112 113 114 115 |
# File 'actionpack/lib/action_dispatch/journey/route.rb', line 109 def score(supplied_keys) path.required_names.each do |k| return -1 unless supplied_keys.include?(k) end (required_defaults.length * 2) + path.names.count { |k| supplied_keys.include?(k) } end |