Class: VerboseRegexp
Instance Attribute Summary collapse
-
#k ⇒ Object
Returns the value of attribute k.
-
#result_proc ⇒ Object
Returns the value of attribute result_proc.
Instance Method Summary collapse
Methods inherited from Regexp
ROMAN, ROMAN_PATTERN, #interpolate, #interpolate_roman
Instance Attribute Details
#result_proc ⇒ Object
Returns the value of attribute result_proc.
41 42 43 |
# File 'lib/regexp.rb', line 41 def result_proc @result_proc end |
Instance Method Details
#match(*a) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/regexp.rb', line 43 def match(*a) m = super s = "MatchData breakdown for #{@k}: " if m s += "\n" + m.display_breakdown else s += 'no match' end @result_proc.call :match, s m end |