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