class RuboCop::Cop::VariableForce::Reference
This class represents each reference of a variable.
def explicit?
In this case, the variable `foo` is not explicitly referenced,
end
super
def some_method(foo)
There's an implicit variable reference by the zero-arity `super`:
def explicit? @node.type != ZERO_ARITY_SUPER_TYPE end
def initialize(node, scope)
def initialize(node, scope) unless VARIABLE_REFERENCE_TYPES.include?(node.type) fail ArgumentError, "Node type must be any of #{VARIABLE_REFERENCE_TYPES}, " \ "passed #{node.type}" end @node = node @scope = scope end