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

Represents a singleton method definition (i.e. def self.foo; end) More...

#include <nodes.hpp>

Public Attributes

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

Detailed Description

Represents a singleton method definition (i.e. def self.foo; end)

Member Data Documentation

◆ args

Node* lib_ruby_parser::Defs::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::Defs::assignment_l

Location of the = operator for endless method definition

def self.foo() = 42
^

None for regular method definition

◆ body

Node* lib_ruby_parser::Defs::body

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

◆ definee

Node* lib_ruby_parser::Defs::definee

Definee of a method definition, Lvar("x") for def x.foo; end

◆ end_l

MaybeLoc lib_ruby_parser::Defs::end_l

Location of the end keyword

def self.foo; end
^^^

None for endless method definition

◆ expression_l

Loc lib_ruby_parser::Defs::expression_l

Location of the full expression

def self.foo; end
^^^^^^^^^^^^^^^^^

◆ keyword_l

Loc lib_ruby_parser::Defs::keyword_l

Location of the def keyword

def self.foo; end
^^^

◆ name

String lib_ruby_parser::Defs::name

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

◆ name_l

Loc lib_ruby_parser::Defs::name_l

Location of the method name

def self.foo; end
^^^

◆ operator_l

Loc lib_ruby_parser::Defs::operator_l

Location of the .

def self.foo; end
^

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