method

of

ruby latest stable - Class: RubyVM::AbstractSyntaxTree

Method not available on this version

This method is only available on newer versions. The first available version (v2_6_3) is shown here.

of(p1)
public

Returns AST nodes of the given proc or method.

RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => #<RubyVM::AbstractSyntaxTree::Node(NODE_SCOPE(0) 1:35, 1:42): >

def hello
  puts "hello, world"
end

RubyVM::AbstractSyntaxTree.of(method(:hello))
# => #<RubyVM::AbstractSyntaxTree::Node(NODE_SCOPE(0) 1:0, 3:3): >