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

Represents a Ruby block that is passed to a method (proc { |foo| bar }) More...

#include <nodes.hpp>

Public Attributes

Nodecall
 
Nodeargs
 
Nodebody
 Block body, None if block has no body. More...
 
Loc begin_l
 
Loc end_l
 
Loc expression_l
 

Detailed Description

Represents a Ruby block that is passed to a method (proc { |foo| bar })

Member Data Documentation

◆ args

Node* lib_ruby_parser::Block::args

A list of argument that block takes

vec![ Arg("a"), Optarg("b", Int("1")) ] for proc { |a, b = 1| }

None if the block takes no arguments

◆ begin_l

Loc lib_ruby_parser::Block::begin_l

Location of the open brace

proc { }
^

◆ body

Node* lib_ruby_parser::Block::body

Block body, None if block has no body.

◆ call

Node* lib_ruby_parser::Block::call

Method call that takes a block

Send("foo") in foo {}

◆ end_l

Loc lib_ruby_parser::Block::end_l

Location of the closing brace

proc { }
^

◆ expression_l

Loc lib_ruby_parser::Block::expression_l

Location of the full expression

proc { }
^^^^^^^^

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