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].
-
#copy(**params) ⇒ Object
def copy: (**params) -> EmbeddedVariableNode.
- #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
2723 2724 2725 2726 2727 |
# File 'lib/yarp/node.rb', line 2723 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
2717 2718 2719 |
# File 'lib/yarp/node.rb', line 2717 def operator_loc @operator_loc end |
#variable ⇒ Object (readonly)
attr_reader variable: Node
2720 2721 2722 |
# File 'lib/yarp/node.rb', line 2720 def variable @variable end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
2730 2731 2732 |
# File 'lib/yarp/node.rb', line 2730 def accept(visitor) visitor.(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
2735 2736 2737 |
# File 'lib/yarp/node.rb', line 2735 def child_nodes [variable] end |
#copy(**params) ⇒ Object
def copy: (**params) -> EmbeddedVariableNode
2740 2741 2742 2743 2744 2745 2746 |
# File 'lib/yarp/node.rb', line 2740 def copy(**params) EmbeddedVariableNode.new( params.fetch(:operator_loc) { operator_loc }, params.fetch(:variable) { variable }, params.fetch(:location) { location }, ) end |
#deconstruct_keys(keys) ⇒ Object
2752 2753 2754 |
# File 'lib/yarp/node.rb', line 2752 def deconstruct_keys(keys) { operator_loc: operator_loc, variable: variable, location: location } end |
#operator ⇒ Object
def operator: () -> String
2757 2758 2759 |
# File 'lib/yarp/node.rb', line 2757 def operator operator_loc.slice end |