Class: YARP::ReturnNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::ReturnNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents the use of the ‘return` keyword.
return 1
^^^^^^^^
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
attr_reader arguments: Node?.
-
#keyword_loc ⇒ Object
readonly
attr_reader keyword_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(keyword_loc, arguments, location) ⇒ ReturnNode
constructor
def initialize: (keyword_loc: Location, arguments: Node?, location: Location) -> void.
-
#keyword ⇒ Object
def keyword: () -> String.
Constructor Details
#initialize(keyword_loc, arguments, location) ⇒ ReturnNode
def initialize: (keyword_loc: Location, arguments: Node?, location: Location) -> void
5397 5398 5399 5400 5401 |
# File 'lib/yarp/node.rb', line 5397 def initialize(keyword_loc, arguments, location) @keyword_loc = keyword_loc @arguments = arguments @location = location end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
attr_reader arguments: Node?
5394 5395 5396 |
# File 'lib/yarp/node.rb', line 5394 def arguments @arguments end |
#keyword_loc ⇒ Object (readonly)
attr_reader keyword_loc: Location
5391 5392 5393 |
# File 'lib/yarp/node.rb', line 5391 def keyword_loc @keyword_loc end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
5404 5405 5406 |
# File 'lib/yarp/node.rb', line 5404 def accept(visitor) visitor.visit_return_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
5410 5411 5412 |
# File 'lib/yarp/node.rb', line 5410 def child_nodes [arguments] end |
#deconstruct_keys(keys) ⇒ Object
5418 5419 5420 |
# File 'lib/yarp/node.rb', line 5418 def deconstruct_keys(keys) { keyword_loc: keyword_loc, arguments: arguments, location: location } end |
#keyword ⇒ Object
def keyword: () -> String
5423 5424 5425 |
# File 'lib/yarp/node.rb', line 5423 def keyword keyword_loc.slice end |