method

offsets

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: Pattern
offsets() private

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/path/pattern.rb, line 185
          def offsets
            @offsets ||= begin
              offsets = [0]

              spec.find_all(&:symbol?).each do |node|
                node = node.to_sym

                if @requirements.key?(node)
                  re = /#{Regexp.union(@requirements[node])}|/
                  offsets.push((re.match("").length - 1) + offsets.last)
                else
                  offsets << offsets.last
                end
              end

              offsets
            end
          end
Register or log in to add new notes.