Prefer String#chomp over String#sub

This commit is contained in:
Markus Schirp 2014-06-29 22:21:47 +00:00
parent d107821b4c
commit 4d08889a7c

View file

@ -6,7 +6,7 @@ module Mutant
Types::ALL.each do |type|
fail "method: #{type} is already defined" if instance_methods(true).include?(type)
name = "n_#{type.to_s.sub(/\??\z/, '?')}"
name = "n_#{type.to_s.chomp('?')}?"
define_method(name) do |node|
node.type.equal?(type)