Class: YARP::InstanceVariableOperatorWriteNode
- Inherits:
-
YARPNode
- Object
- YARPNode
- YARP::InstanceVariableOperatorWriteNode
- Defined in:
- lib/yarp/node.rb,
ext/yarp/api_node.c
Overview
Represents assigning to an instance variable using an operator that isn’t ‘=`.
@target += value
^^^^^^^^^^^^^^^^
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
attr_reader name: Symbol.
-
#name_loc ⇒ Object
readonly
attr_reader name_loc: Location.
-
#operator ⇒ Object
readonly
attr_reader operator: Symbol.
-
#operator_loc ⇒ Object
readonly
attr_reader operator_loc: Location.
-
#value ⇒ Object
readonly
attr_reader value: 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) -> InstanceVariableOperatorWriteNode.
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(name, name_loc, operator_loc, value, operator, location) ⇒ InstanceVariableOperatorWriteNode
constructor
def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void.
Constructor Details
#initialize(name, name_loc, operator_loc, value, operator, location) ⇒ InstanceVariableOperatorWriteNode
def initialize: (name: Symbol, name_loc: Location, operator_loc: Location, value: Node, operator: Symbol, location: Location) -> void
3972 3973 3974 3975 3976 3977 3978 3979 |
# File 'lib/yarp/node.rb', line 3972 def initialize(name, name_loc, operator_loc, value, operator, location) @name = name @name_loc = name_loc @operator_loc = operator_loc @value = value @operator = operator @location = location end |
Instance Attribute Details
#name ⇒ Object (readonly)
attr_reader name: Symbol
3957 3958 3959 |
# File 'lib/yarp/node.rb', line 3957 def name @name end |
#name_loc ⇒ Object (readonly)
attr_reader name_loc: Location
3960 3961 3962 |
# File 'lib/yarp/node.rb', line 3960 def name_loc @name_loc end |
#operator ⇒ Object (readonly)
attr_reader operator: Symbol
3969 3970 3971 |
# File 'lib/yarp/node.rb', line 3969 def operator @operator end |
#operator_loc ⇒ Object (readonly)
attr_reader operator_loc: Location
3963 3964 3965 |
# File 'lib/yarp/node.rb', line 3963 def operator_loc @operator_loc end |
#value ⇒ Object (readonly)
attr_reader value: Node
3966 3967 3968 |
# File 'lib/yarp/node.rb', line 3966 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
def accept: (visitor: Visitor) -> void
3982 3983 3984 |
# File 'lib/yarp/node.rb', line 3982 def accept(visitor) visitor.visit_instance_variable_operator_write_node(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
def child_nodes: () -> Array[nil | Node]
3987 3988 3989 |
# File 'lib/yarp/node.rb', line 3987 def child_nodes [value] end |
#copy(**params) ⇒ Object
def copy: (**params) -> InstanceVariableOperatorWriteNode
3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 |
# File 'lib/yarp/node.rb', line 3992 def copy(**params) InstanceVariableOperatorWriteNode.new( params.fetch(:name) { name }, params.fetch(:name_loc) { name_loc }, params.fetch(:operator_loc) { operator_loc }, params.fetch(:value) { value }, params.fetch(:operator) { operator }, params.fetch(:location) { location }, ) end |
#deconstruct_keys(keys) ⇒ Object
4007 4008 4009 |
# File 'lib/yarp/node.rb', line 4007 def deconstruct_keys(keys) { name: name, name_loc: name_loc, operator_loc: operator_loc, value: value, operator: operator, location: location } end |