Package org.ruby_lang.prism
Class Nodes.CallOrWriteNode
java.lang.Object
org.ruby_lang.prism.Nodes.Node
org.ruby_lang.prism.Nodes.CallOrWriteNode
- Enclosing class:
- Nodes
Represents the use of the `||=` operator on a call.
foo.bar ||= value
^^^^^^^^^^^^^^^^^
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal shortfinal byte[]Represents the name of the method being called.final Nodes.NodeThe object that the method is being called on.final Nodes.NodeRepresents the value being assigned.final byte[]Represents the name of the method being written to.Fields inherited from class org.ruby_lang.prism.Nodes.Node
EMPTY_ARRAY, length, nodeId, startOffset -
Constructor Summary
ConstructorsConstructorDescriptionCallOrWriteNode(int nodeId, int startOffset, int length, short flags, Nodes.Node receiver, byte[] read_name, byte[] write_name, Nodes.Node value) -
Method Summary
Modifier and TypeMethodDescription<T> Taccept(AbstractNodeVisitor<T> visitor) booleanbooleanbooleanbooleanprotected String<T> voidvisitChildNodes(AbstractNodeVisitor<T> visitor) Methods inherited from class org.ruby_lang.prism.Nodes.Node
endOffset, hasNewLineFlag, setNewLineFlag, setNewLineFlag, toString
-
Field Details
-
flags
public final short flags -
receiver
The object that the method is being called on. This can be either `nil` or any [non-void expressions](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). foo.bar ||= value ^^^ -
read_name
public final byte[] read_nameRepresents the name of the method being called. foo.bar ||= value # read_name `:bar` ^^^ -
write_name
public final byte[] write_nameRepresents the name of the method being written to. foo.bar ||= value # write_name `:bar=` ^^^ -
value
Represents the value being assigned. foo.bar ||= value ^^^^^
-
-
Constructor Details
-
CallOrWriteNode
public CallOrWriteNode(int nodeId, int startOffset, int length, short flags, Nodes.Node receiver, byte[] read_name, byte[] write_name, Nodes.Node value)
-
-
Method Details
-
isVariableCall
public boolean isVariableCall() -
isAttributeWrite
public boolean isAttributeWrite() -
isIgnoreVisibility
public boolean isIgnoreVisibility() -
visitChildNodes
- Specified by:
visitChildNodesin classNodes.Node
-
childNodes
- Specified by:
childNodesin classNodes.Node
-
accept
- Specified by:
acceptin classNodes.Node
-
toString
- Specified by:
toStringin classNodes.Node