Class: ActionDispatch::Journey::Path::Pattern::MatchData
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | actionpack/lib/action_dispatch/journey/path/pattern.rb |
Class Method Summary
- .new(names, offsets, match) ⇒ MatchData constructor
Instance Attribute Summary
- #names readonly
Instance Method Summary
Constructor Details
.new(names, offsets, match) ⇒ MatchData
Instance Attribute Details
#names (readonly)
[ GitHub ]# File 'actionpack/lib/action_dispatch/journey/path/pattern.rb', line 125
attr_reader :names
Instance Method Details
#[](x)
[ GitHub ]# File 'actionpack/lib/action_dispatch/journey/path/pattern.rb', line 141
def [](x) idx = @offsets[x - 1] + x @match[idx] end
#captures
[ GitHub ]#length
[ GitHub ]# File 'actionpack/lib/action_dispatch/journey/path/pattern.rb', line 146
def length @offsets.length end
#named_captures
[ GitHub ]# File 'actionpack/lib/action_dispatch/journey/path/pattern.rb', line 137
def named_captures @names.zip(captures).to_h end
#post_match
[ GitHub ]# File 'actionpack/lib/action_dispatch/journey/path/pattern.rb', line 150
def post_match @match.post_match end
#to_s
[ GitHub ]# File 'actionpack/lib/action_dispatch/journey/path/pattern.rb', line 154
def to_s @match.to_s end