Class: YARP::SourceEncodingNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::SourceEncodingNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents the use of the ‘__ENCODING__` keyword.
__ENCODING__
^^^^^^^^^^^^
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) -> SourceEncodingNode.
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(location) ⇒ SourceEncodingNode
constructor
def initialize: (location: Location) -> void.
- #inspect(inspector = NodeInspector.new) ⇒ Object
Constructor Details
#initialize(location) ⇒ SourceEncodingNode
def initialize: (location: Location) -> void
9283 9284 9285 |
# File 'lib/yarp/node.rb', line 9283 def initialize(location) @location = location end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
9288 9289 9290 |
# File 'lib/yarp/node.rb', line 9288 def accept(visitor) visitor.visit_source_encoding_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
9293 9294 9295 |
# File 'lib/yarp/node.rb', line 9293 def child_nodes [] end |
#comment_targets ⇒ Object
def comment_targets: () -> Array[Node | Location]
9298 9299 9300 |
# File 'lib/yarp/node.rb', line 9298 def comment_targets [] end |
#copy(**params) ⇒ Object
def copy: (**params) -> SourceEncodingNode
9303 9304 9305 9306 9307 |
# File 'lib/yarp/node.rb', line 9303 def copy(**params) SourceEncodingNode.new( params.fetch(:location) { location }, ) end |
#deconstruct_keys(keys) ⇒ Object
9313 9314 9315 |
# File 'lib/yarp/node.rb', line 9313 def deconstruct_keys(keys) { location: location } end |
#inspect(inspector = NodeInspector.new) ⇒ Object
9317 9318 9319 9320 |
# File 'lib/yarp/node.rb', line 9317 def inspect(inspector = NodeInspector.new) inspector << inspector.header(self) inspector.to_str end |