Class: YARP::BlockArgumentNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::BlockArgumentNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents block method arguments.
bar(&args)
^^^^^^^^^^
Instance Attribute Summary collapse
-
#expression ⇒ Object
readonly
attr_reader expression: Node?.
-
#operator_loc ⇒ Object
readonly
attr_reader operator_loc: Location.
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void.
-
#child_nodes ⇒ Object
(also: #deconstruct)
def child_nodes: () -> Array[nil | Node].
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(expression, operator_loc, location) ⇒ BlockArgumentNode
constructor
def initialize: (expression: Node?, operator_loc: Location, location: Location) -> void.
-
#operator ⇒ Object
def operator: () -> String.
Constructor Details
#initialize(expression, operator_loc, location) ⇒ BlockArgumentNode
def initialize: (expression: Node?, operator_loc: Location, location: Location) -> void
514 515 516 517 518 |
# File 'lib/yarp/node.rb', line 514 def initialize(expression, operator_loc, location) @expression = expression @operator_loc = operator_loc @location = location end |
Instance Attribute Details
#expression ⇒ Object (readonly)
attr_reader expression: Node?
508 509 510 |
# File 'lib/yarp/node.rb', line 508 def expression @expression end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
511 512 513 |
# File 'lib/yarp/node.rb', line 511 def operator_loc @operator_loc end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
521 522 523 |
# File 'lib/yarp/node.rb', line 521 def accept(visitor) visitor.visit_block_argument_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
527 528 529 |
# File 'lib/yarp/node.rb', line 527 def child_nodes [expression] end |
#deconstruct_keys(keys) ⇒ Object
535 536 537 |
# File 'lib/yarp/node.rb', line 535 def deconstruct_keys(keys) { expression: expression, operator_loc: operator_loc, location: location } end |
#operator ⇒ Object
def operator: () -> String
540 541 542 |
# File 'lib/yarp/node.rb', line 540 def operator operator_loc.slice end |