Skip to content
On this page
class · Ruby 4.0

Prism::BlockNode

< Prism::Node 16 instance methods 2 class methods

Represents a block of ruby code.

[1, 2, 3].each { |i| puts x }
               ^^^^^^^^^^^^^^

Class methods 2

Instance methods 16

Attributes
Read

The body of the block.

[1, 2, 3].each { |i| puts x }
                     ^^^^^^
Read

The local variables declared in the block.

[1, 2, 3].each { |i| puts x } # locals: [:i]
                  ^
Read

The parameters of the block.

[1, 2, 3].each { |i| puts x }
                 ^^^
[1, 2, 3].each { puts _1 }
               ^^^^^^^^^^^
[1, 2, 3].each { puts it }
               ^^^^^^^^^^^