Method: RuboCop::Cop::VariableForce::Reference#explicit?

Defined in:
lib/rubocop/cop/variable_force/reference.rb

#explicit?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

There’s an implicit variable reference by the zero-arity super:

def some_method(foo)
  super
end

Another case is binding:

def some_method(foo)
  do_something(binding)
end

In these cases, the variable foo is not explicitly referenced, but it can be considered used implicitly by the super or binding.

Returns:

  • (Boolean)


41
42
43
# File 'lib/rubocop/cop/variable_force/reference.rb', line 41

def explicit?
  ![ZERO_ARITY_SUPER_TYPE, SEND_TYPE].include?(@node.type)
end