Flowdock
method

offsets

Importance_0
Ruby on Rails latest stable (v6.1.7.7) - 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 176
          def offsets
            return @offsets if @offsets

            @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
Register or log in to add new notes.