Class: YARP::EmbeddedVariableNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::EmbeddedVariableNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents an interpolated variable.
"foo #@bar"
^^^^^
Instance Attribute Summary collapse
-
#operator_loc ⇒ Object
readonly
attr_reader operator_loc: Location.
-
#variable ⇒ Object
readonly
attr_reader variable: Node.
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, variable, location) ⇒ EmbeddedVariableNode
constructor
def initialize: (operator_loc: Location, variable: Node, location: Location) -> void.
-
#operator ⇒ Object
def operator: () -> String.
Constructor Details
#initialize(operator_loc, variable, location) ⇒ EmbeddedVariableNode
def initialize: (operator_loc: Location, variable: Node, location: Location) -> void
2186 2187 2188 2189 2190 |
# File 'lib/yarp/node.rb', line 2186 def initialize(operator_loc, variable, location) @operator_loc = operator_loc @variable = variable @location = location end |
Instance Attribute Details
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
2180 2181 2182 |
# File 'lib/yarp/node.rb', line 2180 def operator_loc @operator_loc end |
#variable ⇒ Object (readonly)
attr_reader variable: Node
2183 2184 2185 |
# File 'lib/yarp/node.rb', line 2183 def variable @variable end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
2193 2194 2195 |
# File 'lib/yarp/node.rb', line 2193 def accept(visitor) visitor.(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
2199 2200 2201 |
# File 'lib/yarp/node.rb', line 2199 def child_nodes [variable] end |
#deconstruct_keys(keys) ⇒ Object
2207 2208 2209 |
# File 'lib/yarp/node.rb', line 2207 def deconstruct_keys(keys) { operator_loc: operator_loc, variable: variable, location: location } end |
#operator ⇒ Object
def operator: () -> String
2212 2213 2214 |
# File 'lib/yarp/node.rb', line 2212 def operator operator_loc.slice end |