class Rubocop::Cop::VariableInspector::Scope

A Scope represents a context of local variable visibility. This is a place where local variables belong to. A scope instance holds a scope node and variable entries.

Attributes

node[R]
variable_entries[R]

Public Class Methods

new(node) click to toggle source
# File lib/rubocop/cop/variable_inspector.rb, line 49
def initialize(node)
  # Accept begin node for top level scope.
  unless SCOPE_TYPES.include?(node.type) || node.type == :begin
    fail ArgumentError,
         "Node type must be any of #{SCOPE_TYPES}, " +
         "passed #{node.type}"
  end
  @node = node
  @variable_entries = {}
end