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
4393 4394 4395 4396 4397 |
# File 'lib/yarp/node.rb', line 4393 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
4390 4391 4392 |
# File 'lib/yarp/node.rb', line 4390 def keyword_loc @keyword_loc end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
4387 4388 4389 |
# File 'lib/yarp/node.rb', line 4387 def operator_loc @operator_loc end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
4400 4401 4402 |
# File 'lib/yarp/node.rb', line 4400 def accept(visitor) visitor.visit_no_keywords_parameter_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
4405 4406 4407 |
# File 'lib/yarp/node.rb', line 4405 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
4413 4414 4415 |
# File 'lib/yarp/node.rb', line 4413 def deconstruct_keys(keys) { operator_loc: operator_loc, keyword_loc: keyword_loc, location: location } end |
#keyword ⇒ Object
def keyword: () -> String
4423 4424 4425 |
# File 'lib/yarp/node.rb', line 4423 def keyword keyword_loc.slice end |
#operator ⇒ Object
def operator: () -> String
4418 4419 4420 |
# File 'lib/yarp/node.rb', line 4418 def operator operator_loc.slice end |