class Journey::Path::Pattern::MatchData - journey-1.0.4 Documentation

# class Journey::Path::Pattern::MatchData

### Attributes

names[R]

### Public Class Methods

new(names, offsets, match) click to toggle source

    # File lib/journey/path/pattern.rb, line 138
    def initialize names, offsets, match
      @names   = names
      @offsets = offsets
      @match   = match
    end

### Public Instance Methods

[](x) click to toggle source

    # File lib/journey/path/pattern.rb, line 148
    def [] x
      idx = @offsets[x - 1] + x
      @match[idx]
    end

captures() click to toggle source

    # File lib/journey/path/pattern.rb, line 144
    def captures
      (length - 1).times.map { |i| self[i + 1] }
    end

length() click to toggle source

    # File lib/journey/path/pattern.rb, line 153
    def length
      @offsets.length
    end

post_match() click to toggle source

    # File lib/journey/path/pattern.rb, line 157
    def post_match
      @match.post_match
    end

to_s() click to toggle source

    # File lib/journey/path/pattern.rb, line 161
    def to_s
      @match.to_s
    end