Package org.jruby.ast
Class OpElementAsgnNode
java.lang.Object
org.jruby.ast.Node
org.jruby.ast.OpElementAsgnNode
Represents an operator assignment to an element.
This could be for example:
a[4] += 5 a[3] &&= true
-
Field Summary
Fields inherited from class org.jruby.ast.Node
containsVariableAssignment, newline
-
Constructor Summary
ConstructorsConstructorDescriptionOpElementAsgnNode
(int line, Node receiverNode, RubySymbol operatorName, Node argsNode, Node valueNode, Node blockNode) -
Method Summary
Modifier and TypeMethodDescription<T> T
accept
(NodeVisitor<T> iVisitor) Accept for the visitor pattern.Gets the argsNode.Gets the operatorName.Gets the receiverNode.Gets the valueNode.boolean
isAnd()
boolean
isOr()
boolean
Check whether the given node is considered always "defined" or whether it has some form of definition check.Methods inherited from class org.jruby.ast.Node
containsVariableAssignment, createList, createList, createList, createList, executesOnce, getFile, getLine, getNodeName, isNewline, isNil, setLine, setNewline, toString, toString, toStringExtraInfo, toStringInternal, unsetNewline
-
Constructor Details
-
OpElementAsgnNode
public OpElementAsgnNode(int line, Node receiverNode, RubySymbol operatorName, Node argsNode, Node valueNode, Node blockNode)
-
-
Method Details
-
getNodeType
- Specified by:
getNodeType
in classNode
- Returns:
- the nodeId
-
accept
Accept for the visitor pattern. -
getArgsNode
Gets the argsNode.- Returns:
- Returns a Node
-
getOperatorName
Gets the operatorName.- Returns:
- Returns a String
-
getOperatorByteName
-
getOperatorSymbolName
-
getReceiverNode
Gets the receiverNode.- Returns:
- Returns a Node
-
isOr
public boolean isOr() -
isAnd
public boolean isAnd() -
getValueNode
Gets the valueNode.- Returns:
- Returns a Node
-
getBlockNode
-
childNodes
- Specified by:
childNodes
in classNode
-
needsDefinitionCheck
public boolean needsDefinitionCheck()Description copied from class:Node
Check whether the given node is considered always "defined" or whether it has some form of definition check.- Overrides:
needsDefinitionCheck
in classNode
- Returns:
- Whether the type of node represents a possibly undefined construct
-