Flowdock
method

score

Importance_0
v4.1.8 - Show latest stable - 0 notes - Class: Route
score(constraints) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_dispatch/journey/route.rb, line 59
      def score(constraints)
        required_keys = path.required_names
        supplied_keys = constraints.map { |k,v| v && k.to_s }.compact

        return -1 unless (required_keys - supplied_keys).empty?

        score = (supplied_keys & path.names).length
        score + (required_defaults.length * 2)
      end
Register or log in to add new notes.