lib-ruby-parser (C++ bindings)  4.0.1+ruby-3.1.1
C++ bindings for lib-ruby-parser library
lib_ruby_parser::Def Class Reference

Represents method definition using def keyword (not on a singleton, see Defs node). More...

#include <nodes.hpp>

Public Attributes

String name
 Name of the method, String("foo") for def foo; end More...
 
Nodeargs
 
Nodebody
 Body of a method, None if there's no body. More...
 
Loc keyword_l
 
Loc name_l
 
MaybeLoc end_l
 
MaybeLoc assignment_l
 
Loc expression_l
 

Detailed Description

Represents method definition using def keyword (not on a singleton, see Defs node).

Member Data Documentation

◆ args

Node* lib_ruby_parser::Def::args

Arguments of a method, None if there's no arguments.

All information about parentheses around arguments is stored in this node.

◆ assignment_l

MaybeLoc lib_ruby_parser::Def::assignment_l

Location of the = operator for endless method definition

def m() = 1
^

None for regular method definition

◆ body

Node* lib_ruby_parser::Def::body

Body of a method, None if there's no body.

◆ end_l

MaybeLoc lib_ruby_parser::Def::end_l

Location of the end keyword.

def foo; end
^^^

None for endless method definition

◆ expression_l

Loc lib_ruby_parser::Def::expression_l

Location of the full expression

def m(a); foo; end
^^^^^^^^^^^^^^^^^^

◆ keyword_l

Loc lib_ruby_parser::Def::keyword_l

Location of the def keyword.

def foo; end
^^^

◆ name

String lib_ruby_parser::Def::name

Name of the method, String("foo") for def foo; end

◆ name_l

Loc lib_ruby_parser::Def::name_l

Location of the method name.

def foo; end
^^^

The documentation for this class was generated from the following file: