Class: YARP::KeywordRestParameterNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::KeywordRestParameterNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents a keyword rest parameter to a method, block, or lambda definition.
def a(**b)
^^^
end
Instance Attribute Summary collapse
-
#name_loc ⇒ Object
readonly
attr_reader name_loc: Location?.
-
#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, name_loc, location) ⇒ KeywordRestParameterNode
constructor
def initialize: (operator_loc: Location, name_loc: Location?, location: Location) -> void.
-
#name ⇒ Object
def name: () -> String?.
-
#operator ⇒ Object
def operator: () -> String.
Constructor Details
#initialize(operator_loc, name_loc, location) ⇒ KeywordRestParameterNode
def initialize: (operator_loc: Location, name_loc: Location?, location: Location) -> void
3715 3716 3717 3718 3719 |
# File 'lib/yarp/node.rb', line 3715 def initialize(operator_loc, name_loc, location) @operator_loc = operator_loc @name_loc = name_loc @location = location end |
Instance Attribute Details
#name_loc ⇒ Object (readonly)
attr_reader name_loc: Location?
3712 3713 3714 |
# File 'lib/yarp/node.rb', line 3712 def name_loc @name_loc end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
3709 3710 3711 |
# File 'lib/yarp/node.rb', line 3709 def operator_loc @operator_loc end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
3722 3723 3724 |
# File 'lib/yarp/node.rb', line 3722 def accept(visitor) visitor.visit_keyword_rest_parameter_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
3727 3728 3729 |
# File 'lib/yarp/node.rb', line 3727 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
3735 3736 3737 |
# File 'lib/yarp/node.rb', line 3735 def deconstruct_keys(keys) { operator_loc: operator_loc, name_loc: name_loc, location: location } end |
#name ⇒ Object
def name: () -> String?
3745 3746 3747 |
# File 'lib/yarp/node.rb', line 3745 def name name_loc&.slice end |
#operator ⇒ Object
def operator: () -> String
3740 3741 3742 |
# File 'lib/yarp/node.rb', line 3740 def operator operator_loc.slice end |