Class: LibRubyParser::Nodes::Procarg0
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::Procarg0
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents a sole block argument (e.g. ‘|foo|`)
Block that takes a single array argument automatically expands it. Adding trailing comma after block argument disables this behavior (and then the only argument is emitted as Arg).
Instance Attribute Summary collapse
-
#args ⇒ ::Array<Node>
readonly
Parts of the sole block argument.
-
#begin_l ⇒ Loc?
readonly
Location of the open parenthesis.
-
#end_l ⇒ Loc?
readonly
Location of the open parenthesis.
-
#expression_l ⇒ Loc
readonly
Location of the full expression.
Instance Attribute Details
#args ⇒ ::Array<Node> (readonly)
Parts of the sole block argument.
‘proc { |(a, b)| }` also counts as a sole argument, so this list may contain:
-
A single
Argnode (for ‘proc { |a| }` case) -
Multiple
Argnodes (for ‘proc { |(a, b, c)| }` case)
3353 3354 3355 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3353 def args @args end |
#begin_l ⇒ Loc? (readonly)
Location of the open parenthesis
“‘text proc { |(foo, bar)| }
~
“‘
None if there’s only one argument
3364 3365 3366 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3364 def begin_l @begin_l end |
#end_l ⇒ Loc? (readonly)
Location of the open parenthesis
“‘text proc { |(foo, bar)| }
~
“‘
None if there’s only one argument
3375 3376 3377 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3375 def end_l @end_l end |
#expression_l ⇒ Loc (readonly)
Location of the full expression
“‘text proc { |(foo, bar)| }
~~~~~~~~~~
“‘
3384 3385 3386 |
# File 'lib/lib-ruby-parser/nodes.rb', line 3384 def expression_l @expression_l end |