Class: Ergo::Match

Inherits:
String
  • Object
show all
Defined in:
lib/ergo/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

Instance Method Details

#intialize(string, matchdata) ⇒ Object

Initialize a new instance of Match.

Parameters:

  • string

    The string. [String]

  • matchdata

    The match data. [MatchData]



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

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

#matchdataMatchData

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

Returns:

  • (MatchData)

    Returns



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

def matchdata
  @matchdata
end