Class: Rrrex::Regexp

Inherits:
Regexp
  • Object
show all
Defined in:
lib/rrrex/regexp.rb

Instance Method Summary collapse

Constructor Details

#initialize(r) ⇒ Regexp

Returns a new instance of Regexp.



4
5
6
7
# File 'lib/rrrex/regexp.rb', line 4

def initialize( r )
  super r.to_regexp_string
  @atom = r
end

Instance Method Details

#match(str) ⇒ Object



9
10
11
12
# File 'lib/rrrex/regexp.rb', line 9

def match( str )
  result = super( str )
  MatchData.new @atom, result unless result.nil?
end