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
505 506 507 508 509 |
# File 'lib/yarp/node.rb', line 505 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?
499 500 501 |
# File 'lib/yarp/node.rb', line 499 def expression @expression end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
502 503 504 |
# File 'lib/yarp/node.rb', line 502 def operator_loc @operator_loc end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
512 513 514 |
# File 'lib/yarp/node.rb', line 512 def accept(visitor) visitor.visit_block_argument_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
517 518 519 |
# File 'lib/yarp/node.rb', line 517 def child_nodes [expression] end |
#deconstruct_keys(keys) ⇒ Object
525 526 527 |
# File 'lib/yarp/node.rb', line 525 def deconstruct_keys(keys) { expression: expression, operator_loc: operator_loc, location: location } end |
#operator ⇒ Object
def operator: () -> String
530 531 532 |
# File 'lib/yarp/node.rb', line 530 def operator operator_loc.slice end |