Class: YARP::AssocSplatNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::AssocSplatNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents a splat in a hash literal.
{ **foo }
^^^^^
Instance Attribute Summary collapse
-
#operator_loc ⇒ Object
readonly
attr_reader operator_loc: Location.
-
#value ⇒ Object
readonly
attr_reader value: Node?.
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(value, operator_loc, location) ⇒ AssocSplatNode
constructor
def initialize: (value: Node?, operator_loc: Location, location: Location) -> void.
-
#operator ⇒ Object
def operator: () -> String.
Constructor Details
#initialize(value, operator_loc, location) ⇒ AssocSplatNode
def initialize: (value: Node?, operator_loc: Location, location: Location) -> void
372 373 374 375 376 |
# File 'lib/yarp/node.rb', line 372 def initialize(value, operator_loc, location) @value = value @operator_loc = operator_loc @location = location end |
Instance Attribute Details
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
369 370 371 |
# File 'lib/yarp/node.rb', line 369 def operator_loc @operator_loc end |
#value ⇒ Object (readonly)
attr_reader value: Node?
366 367 368 |
# File 'lib/yarp/node.rb', line 366 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
379 380 381 |
# File 'lib/yarp/node.rb', line 379 def accept(visitor) visitor.visit_assoc_splat_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
385 386 387 |
# File 'lib/yarp/node.rb', line 385 def child_nodes [value] end |
#deconstruct_keys(keys) ⇒ Object
393 394 395 |
# File 'lib/yarp/node.rb', line 393 def deconstruct_keys(keys) { value: value, operator_loc: operator_loc, location: location } end |
#operator ⇒ Object
def operator: () -> String
398 399 400 |
# File 'lib/yarp/node.rb', line 398 def operator operator_loc.slice end |