instance method
RubyVM::AbstractSyntaxTree::Node#type
() -> ::Symbol
node.type → symbol
ast.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/ast.rb, line 132
def type
Primitive.ast_node_type
end
Returns the type of this node as a symbol.
Example
root = RubyVM::AbstractSyntaxTree.parse("x = 1 + 2") root.type # => :SCOPE lasgn = root.children[2] lasgn.type # => :LASGN call = lasgn.children[1] call.type # => :OPCALL