Class: RegexpBench::DontMatchString

Inherits:
MatchString show all
Defined in:
lib/regexp-bench/regexp-bench.rb

Instance Attribute Summary

Attributes inherited from MatchString

#string

Instance Method Summary collapse

Methods inherited from MatchString

#initialize, #test_match, #to_s

Constructor Details

This class inherits a constructor from RegexpBench::MatchString

Instance Method Details

#listObject



53
54
55
# File 'lib/regexp-bench/regexp-bench.rb', line 53

def list
  puts "Don't Match: " + string
end

#matched(match) ⇒ Object



61
62
63
64
65
66
67
68
# File 'lib/regexp-bench/regexp-bench.rb', line 61

def matched(match)
  item "ERROR: match:", {:color => :red}
  item "Before: " + match.pre_match, {:color => :magenta}
  match.to_a.each_index do |idx|
    puts "m[#{idx}]: #{match[idx]}"
  end
  item "After: " + match.post_match, {:color => :magenta}
end

#null_matchObject



57
58
59
# File 'lib/regexp-bench/regexp-bench.rb', line 57

def null_match
  item "Successful null match", {:color => :green}
end