Class: YARP::SplatNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::SplatNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents the use of the splat operator.
[*a]
^^
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(operator_loc, expression, location) ⇒ SplatNode
constructor
def initialize: (operator_loc: Location, expression: Node?, location: Location) -> void.
-
#operator ⇒ Object
def operator: () -> String.
Constructor Details
#initialize(operator_loc, expression, location) ⇒ SplatNode
def initialize: (operator_loc: Location, expression: Node?, location: Location) -> void
5678 5679 5680 5681 5682 |
# File 'lib/yarp/node.rb', line 5678 def initialize(operator_loc, expression, location) @operator_loc = operator_loc @expression = expression @location = location end |
Instance Attribute Details
#expression ⇒ Object (readonly)
attr_reader expression: Node?
5675 5676 5677 |
# File 'lib/yarp/node.rb', line 5675 def expression @expression end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
5672 5673 5674 |
# File 'lib/yarp/node.rb', line 5672 def operator_loc @operator_loc end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
5685 5686 5687 |
# File 'lib/yarp/node.rb', line 5685 def accept(visitor) visitor.visit_splat_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
5690 5691 5692 |
# File 'lib/yarp/node.rb', line 5690 def child_nodes [expression] end |
#deconstruct_keys(keys) ⇒ Object
5698 5699 5700 |
# File 'lib/yarp/node.rb', line 5698 def deconstruct_keys(keys) { operator_loc: operator_loc, expression: expression, location: location } end |
#operator ⇒ Object
def operator: () -> String
5703 5704 5705 |
# File 'lib/yarp/node.rb', line 5703 def operator operator_loc.slice end |