class ActionDispatch::Journey::Path::Pattern::MatchData

Experimental RBS support (using type sampling data from the type_fusion project).

# sig/action_dispatch/journey/path/pattern.rbs

class ActionDispatch::Journey::Path::Pattern::MatchData
  def []: (Integer x) -> String?
  def initialize: (Array[String] names, Array[Integer] offsets, MatchData match) -> void
end

:nodoc:

def [](x)

Experimental RBS support (using type sampling data from the type_fusion project).

def []: (Integer x) -> String?

This signature was generated using 7 samples from 1 application.

def [](x)
  idx = @offsets[x - 1] + x
  @match[idx]
end

def captures

def captures
  Array.new(length - 1) { |i| self[i + 1] }
end

def initialize(names, offsets, match)

Experimental RBS support (using type sampling data from the type_fusion project).

def initialize: ((String | String | String | String | String | ) names, (Integer | Integer | Integer | Integer | Integer | Integer | Integer | Integer) offsets, MatchData match) -> void

This signature was generated using 5 samples from 1 application.

def initialize(names, offsets, match)
  @names   = names
  @offsets = offsets
  @match   = match
end

def length

def length
  @offsets.length
end

def named_captures

def named_captures
  @names.zip(captures).to_h
end

def post_match

def post_match
  @match.post_match
end

def to_s

def to_s
  @match.to_s
end