Sha256: f385196205e076497c86eca0390de5f84d65175eb8af63b06bcdac9b5a81dbbe

Contents?: true

Size: 429 Bytes

Versions: 9

Compression:

Stored size: 429 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module AST
    # A node extension for `lvar`, `ivar`, `cvar` and `gvar` nodes.
    # This will be used in place of a plain node when the builder constructs
    # the AST, making its methods available to all assignment nodes within RuboCop.
    class VarNode < Node
      # @return [Symbol] The name of the variable.
      def name
        node_parts[0]
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rubocop-ast-1.37.0 lib/rubocop/ast/node/var_node.rb
rubocop-ast-1.36.2 lib/rubocop/ast/node/var_node.rb
rubocop-ast-1.36.1 lib/rubocop/ast/node/var_node.rb
rubocop-ast-1.36.0 lib/rubocop/ast/node/var_node.rb
rubocop-ast-1.35.0 lib/rubocop/ast/node/var_node.rb
rubocop-ast-1.34.1 lib/rubocop/ast/node/var_node.rb
rubocop-ast-1.34.0 lib/rubocop/ast/node/var_node.rb
rubocop-ast-1.33.1 lib/rubocop/ast/node/var_node.rb
rubocop-ast-1.33.0 lib/rubocop/ast/node/var_node.rb