class RuboCop::Cop::InternalAffairs::LocationExists

When a node location may not exist, ‘Node#loc?` or `Node#loc_is?` can be used instead of calling `Node#respond_to?` before using the value.

@example

# bad
node.loc.respond_to?(:begin) && node.loc.begin

# good
node.loc?(:begin)

# bad
node.loc.respond_to?(:begin) && node.loc.begin.is?('(')

# good
node.loc_is?(:begin, '(')

# bad
node.loc.respond_to?(:begin) && node.loc.begin.source == '('

# good
node.loc_is?(:begin, '(')