Class: YARP::ClassVariableReadNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::ClassVariableReadNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents referencing a class variable.
@@foo
^^^^^
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) -> ClassVariableReadNode.
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(name, location) ⇒ ClassVariableReadNode
constructor
def initialize: (name: Symbol, location: Location) -> void.
Constructor Details
#initialize(name, location) ⇒ ClassVariableReadNode
def initialize: (name: Symbol, location: Location) -> void
1599 1600 1601 1602 |
# File 'lib/yarp/node.rb', line 1599 def initialize(name, location) @name = name @location = location end |
Instance Attribute Details
#name ⇒ Object (readonly)
attr_reader name: Symbol
1596 1597 1598 |
# File 'lib/yarp/node.rb', line 1596 def name @name end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
1605 1606 1607 |
# File 'lib/yarp/node.rb', line 1605 def accept(visitor) visitor.visit_class_variable_read_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
1610 1611 1612 |
# File 'lib/yarp/node.rb', line 1610 def child_nodes [] end |
#copy(**params) ⇒ Object
def copy: (**params) -> ClassVariableReadNode
1615 1616 1617 1618 1619 1620 |
# File 'lib/yarp/node.rb', line 1615 def copy(**params) ClassVariableReadNode.new( params.fetch(:name) { name }, params.fetch(:location) { location }, ) end |