Method: RuboCop::Cop::InternalAffairs::LocationExists#replaceable_with_loc_is

Defined in:
lib/rubocop/cop/internal_affairs/location_exists.rb

#replaceable_with_loc_is(node) ⇒ Object

[View source]

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/rubocop/cop/internal_affairs/location_exists.rb', line 35

def_node_matcher :replaceable_with_loc_is, <<~PATTERN
  (and
    (call
      (call $_receiver :loc) :respond_to?
      $(sym _location))
    {
      (call
        (call
          (call _receiver :loc) _location) :is?
        $(str _))
      (call
        (call
          (call
            (call _receiver :loc) _location) :source) :==
            $(str _))
    })
PATTERN