Class: Parser::AST::Node
Overview
Node contains information about a single AST node and its
child nodes. It extends the basic [AST::Node](https://www.rubydoc.info/gems/ast/AST/Node)
class provided by gem [ast](https://www.rubydoc.info/gems/ast).
Instance Attribute Summary
-
#loc
readonly
Alias for #location.
-
#location ⇒ Parser::Source::Map
(also: #loc)
readonly
Source map for this Node.
Instance Method Summary
-
#assign_properties(properties)
Assigns various properties to this AST node.
Instance Attribute Details
#loc (readonly)
Alias for #location.
# File 'lib/rubocop/ast/vendor/parser/ast/node.rb', line 20
alias loc location
#location ⇒ Parser::Source::Map (readonly) Also known as: #loc
Source map for this Node.
# File 'lib/rubocop/ast/vendor/parser/ast/node.rb', line 17
class Node < ::AST::Node attr_reader :location alias loc location ## # Assigns various properties to this AST node. Currently only the # location can be set. # # @param [Hash] properties # @option properties [Parser::Source::Map] :location Location information # of the node. # def assign_properties(properties) if (location = properties[:location]) location = location.dup if location.frozen? location.node = self @location = location end end end
Instance Method Details
#assign_properties(properties)
Assigns various properties to this AST node. Currently only the location can be set.