Class: YARP::NoKeywordsParameterNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::NoKeywordsParameterNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents the use of ‘**nil` inside method arguments.
def a(**nil)
^^^^^
end
Instance Attribute Summary collapse
-
#keyword_loc ⇒ Object
readonly
attr_reader keyword_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, keyword_loc, location) ⇒ NoKeywordsParameterNode
constructor
def initialize: (operator_loc: Location, keyword_loc: Location, location: Location) -> void.
-
#keyword ⇒ Object
def keyword: () -> String.
-
#operator ⇒ Object
def operator: () -> String.
Constructor Details
#initialize(operator_loc, keyword_loc, location) ⇒ NoKeywordsParameterNode
def initialize: (operator_loc: Location, keyword_loc: Location, location: Location) -> void
4368 4369 4370 4371 4372 |
# File 'lib/yarp/node.rb', line 4368 def initialize(operator_loc, keyword_loc, location) @operator_loc = operator_loc @keyword_loc = keyword_loc @location = location end |
Instance Attribute Details
#keyword_loc ⇒ Object (readonly)
attr_reader keyword_loc: Location
4365 4366 4367 |
# File 'lib/yarp/node.rb', line 4365 def keyword_loc @keyword_loc end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
4362 4363 4364 |
# File 'lib/yarp/node.rb', line 4362 def operator_loc @operator_loc end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
4375 4376 4377 |
# File 'lib/yarp/node.rb', line 4375 def accept(visitor) visitor.visit_no_keywords_parameter_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
4381 4382 4383 |
# File 'lib/yarp/node.rb', line 4381 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
4389 4390 4391 |
# File 'lib/yarp/node.rb', line 4389 def deconstruct_keys(keys) { operator_loc: operator_loc, keyword_loc: keyword_loc, location: location } end |
#keyword ⇒ Object
def keyword: () -> String
4399 4400 4401 |
# File 'lib/yarp/node.rb', line 4399 def keyword keyword_loc.slice end |
#operator ⇒ Object
def operator: () -> String
4394 4395 4396 |
# File 'lib/yarp/node.rb', line 4394 def operator operator_loc.slice end |