Routing question

In routing.rb, what is the purpose of the following piece of code:

class Regexp
def number_of_captures
Regexp.new("|#{source}").match(’’).captures.length
end

Does this method not always return 0? It’s always going to match ‘’
with the blank spot before the | and therefore will have no captures.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs