Package org.jruby.ast
Class CallNode
java.lang.Object
org.jruby.ast.Node
org.jruby.ast.CallNode
- All Implemented Interfaces:
BlockAcceptingNode
,CanRaise
,IArgumentNode
,INameNode
- Direct Known Subclasses:
OperatorCallNode
public class CallNode
extends Node
implements INameNode, IArgumentNode, BlockAcceptingNode, CanRaise
A method or operator call.
-
Field Summary
FieldsFields inherited from class org.jruby.ast.Node
containsVariableAssignment, newline
-
Constructor Summary
ConstructorsConstructorDescriptionCallNode
(int line, Node receiverNode, RubySymbol name, Node argsNode, Node iterNode, boolean isLazy) -
Method Summary
Modifier and TypeMethodDescription<T> T
accept
(NodeVisitor<T> iVisitor) Accept for the visitor pattern.Gets the argsNode representing the method's arguments' value for this call.getName()
Gets the name.Gets the receiverNode.boolean
isLazy()
Is this call lazily execute because it was on right hand side of the lonely (&.) operator?setArgsNode
(Node argsNode) Set the argsNode.setIterNode
(Node iterNode) protected String
Overridden by nodes that have additional internal state to be displated in toString.Methods inherited from class org.jruby.ast.Node
containsVariableAssignment, createList, createList, createList, createList, executesOnce, getFile, getLine, getNodeName, isNewline, isNil, needsDefinitionCheck, setLine, setNewline, toString, toString, toStringExtraInfo, unsetNewline
-
Field Details
-
iterNode
-
-
Constructor Details
-
CallNode
public CallNode(int line, Node receiverNode, RubySymbol name, Node argsNode, Node iterNode, boolean isLazy)
-
-
Method Details
-
getNodeType
- Specified by:
getNodeType
in classNode
- Returns:
- the nodeId
-
accept
Accept for the visitor pattern. -
getIterNode
- Specified by:
getIterNode
in interfaceBlockAcceptingNode
-
setIterNode
- Specified by:
setIterNode
in interfaceBlockAcceptingNode
-
getArgsNode
Gets the argsNode representing the method's arguments' value for this call.- Specified by:
getArgsNode
in interfaceIArgumentNode
- Returns:
- argsNode
-
setArgsNode
Set the argsNode. This is for re-writer and not general interpretation.- Specified by:
setArgsNode
in interfaceIArgumentNode
- Parameters:
argsNode
- set the arguments for this node.
-
getName
Gets the name. name is the name of the method called -
getReceiverNode
Gets the receiverNode. receiverNode is the object on which the method is being called- Returns:
- receiverNode
-
isLazy
public boolean isLazy()Is this call lazily execute because it was on right hand side of the lonely (&.) operator?- Returns:
- true if so.
-
childNodes
- Specified by:
childNodes
in classNode
-
toStringInternal
Description copied from class:Node
Overridden by nodes that have additional internal state to be displated in toString.For nodes that have it, name is handled separately, by implementing INameNode.
Child nodes are handled via iterating #childNodes.
- Overrides:
toStringInternal
in classNode
- Returns:
- A string representing internal node state, or null if none.
-