Class: Rulebow::Match

Inherits:
String
  • Object
show all
Defined in:
lib/rulebow/match.rb

Overview

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

Instance Method Summary collapse

Constructor Details

#initialize(string, matchdata) ⇒ Match

Initialize a new instance of Match.



12
13
14
15
# File 'lib/rulebow/match.rb', line 12

def initialize(string, matchdata)
  replace(string)
  @matchdata = matchdata
end

Instance Method Details

#matchdataMatchData

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



21
22
23
# File 'lib/rulebow/match.rb', line 21

def matchdata
  @matchdata
end