class RubbyCop::Cop::Lint::AmbiguousRegexpLiteral
This cop checks for ambiguous regexp literals in the first argument of a method invocation without parentheses.
@example
# bad # This is interpreted as a method invocation with a regexp literal, # but it could possibly be `/` method invocations. # (i.e. `do_something./(pattern)./(i)`) do_something /pattern/i
@example
# good # With parentheses, there's no ambiguity. do_something(/pattern/i)
Constants
- MSG
Private Instance Methods
alternative_message(_diagnostic)
click to toggle source
# File lib/rubbycop/cop/lint/ambiguous_regexp_literal.rb, line 37 def alternative_message(_diagnostic) MSG end
relevant_diagnostic?(diagnostic)
click to toggle source
# File lib/rubbycop/cop/lint/ambiguous_regexp_literal.rb, line 33 def relevant_diagnostic?(diagnostic) diagnostic.reason == :ambiguous_literal end