Class: YARP::SelfNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::SelfNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents the ‘self` keyword.
self
^^^^
Instance Method Summary collapse
-
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void.
-
#child_nodes ⇒ Object
(also: #deconstruct)
def child_nodes: () -> Array[nil | Node].
-
#comment_targets ⇒ Object
def comment_targets: () -> Array[Node | Location].
-
#copy(**params) ⇒ Object
def copy: (**params) -> SelfNode.
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(location) ⇒ SelfNode
constructor
def initialize: (location: Location) -> void.
- #inspect(inspector = NodeInspector.new) ⇒ Object
Constructor Details
#initialize(location) ⇒ SelfNode
def initialize: (location: Location) -> void
9134 9135 9136 |
# File 'lib/yarp/node.rb', line 9134 def initialize(location) @location = location end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
9139 9140 9141 |
# File 'lib/yarp/node.rb', line 9139 def accept(visitor) visitor.visit_self_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
9144 9145 9146 |
# File 'lib/yarp/node.rb', line 9144 def child_nodes [] end |
#comment_targets ⇒ Object
def comment_targets: () -> Array[Node | Location]
9149 9150 9151 |
# File 'lib/yarp/node.rb', line 9149 def comment_targets [] end |
#copy(**params) ⇒ Object
def copy: (**params) -> SelfNode
9154 9155 9156 9157 9158 |
# File 'lib/yarp/node.rb', line 9154 def copy(**params) SelfNode.new( params.fetch(:location) { location }, ) end |
#deconstruct_keys(keys) ⇒ Object
9164 9165 9166 |
# File 'lib/yarp/node.rb', line 9164 def deconstruct_keys(keys) { location: location } end |
#inspect(inspector = NodeInspector.new) ⇒ Object
9168 9169 9170 9171 |
# File 'lib/yarp/node.rb', line 9168 def inspect(inspector = NodeInspector.new) inspector << inspector.header(self) inspector.to_str end |