Consider this: @text = 'foobar' def method1(string) if @text.match(/#{string}/) true else false end end That can be reduced to: def method2(string_or_regex) ...
確定! 回上一頁