Class: YARP::ClassVariableTargetNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::ClassVariableTargetNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents writing to a class variable in a context that doesn’t have an explicit value.
@@foo, @@bar = baz
^^^^^ ^^^^^
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
attr_reader name: Symbol.
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) -> ClassVariableTargetNode.
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(name, location) ⇒ ClassVariableTargetNode
constructor
def initialize: (name: Symbol, location: Location) -> void.
Constructor Details
#initialize(name, location) ⇒ ClassVariableTargetNode
def initialize: (name: Symbol, location: Location) -> void
1640 1641 1642 1643 |
# File 'lib/yarp/node.rb', line 1640 def initialize(name, location) @name = name @location = location end |
Instance Attribute Details
#name ⇒ Object (readonly)
attr_reader name: Symbol
1637 1638 1639 |
# File 'lib/yarp/node.rb', line 1637 def name @name end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
1646 1647 1648 |
# File 'lib/yarp/node.rb', line 1646 def accept(visitor) visitor.visit_class_variable_target_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
1651 1652 1653 |
# File 'lib/yarp/node.rb', line 1651 def child_nodes [] end |
#copy(**params) ⇒ Object
def copy: (**params) -> ClassVariableTargetNode
1656 1657 1658 1659 1660 1661 |
# File 'lib/yarp/node.rb', line 1656 def copy(**params) ClassVariableTargetNode.new( params.fetch(:name) { name }, params.fetch(:location) { location }, ) end |