class Rulebow::Match

Match is a subclass of a string that also stores the MatchData then matched against it in a Regexp comparison.

Public Class Methods

new(string, matchdata) click to toggle source

Initialize a new instance of Match.

string - The string. [String] matchdata - The match data. [MatchData]

# File lib/rulebow/match.rb, line 12
def initialize(string, matchdata)
  replace(string)
  @matchdata = matchdata
end

Public Instance Methods

matchdata() click to toggle source

The match data that resulted from a successful Regexp against the string.

Returns [MatchData]

# File lib/rulebow/match.rb, line 21
def matchdata
  @matchdata
end