Class: YARP::KeywordHashNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::KeywordHashNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents a hash literal without opening and closing braces.
foo(a: b)
^^^^
Instance Attribute Summary collapse
-
#elements ⇒ Object
readonly
attr_reader elements: Array.
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(elements, location) ⇒ KeywordHashNode
constructor
def initialize: (elements: Array, location: Location) -> void.
Constructor Details
#initialize(elements, location) ⇒ KeywordHashNode
def initialize: (elements: Array, location: Location) -> void
3590 3591 3592 3593 |
# File 'lib/yarp/node.rb', line 3590 def initialize(elements, location) @elements = elements @location = location end |
Instance Attribute Details
#elements ⇒ Object (readonly)
attr_reader elements: Array
3587 3588 3589 |
# File 'lib/yarp/node.rb', line 3587 def elements @elements end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
3596 3597 3598 |
# File 'lib/yarp/node.rb', line 3596 def accept(visitor) visitor.visit_keyword_hash_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
3602 3603 3604 |
# File 'lib/yarp/node.rb', line 3602 def child_nodes [*elements] end |