class Prism::ArgumentsNode
Represents a set of arguments to a method or a keyword.
return foo, bar, baz
^^^^^^^^^^^^^
Public Class Methods
(Source source, Integer node_id, Location location, Integer flags, Array[Prism::node] arguments) → void
Source
# File lib/prism/node.rb, line 1202 def initialize(source, node_id, location, flags, arguments) @source = source @node_id = node_id @location = location @flags = flags @arguments = arguments end
Initialize a new ArgumentsNode node.
Public Instance Methods
() → Array[Prism::node]
Source
# File lib/prism/node.rb, line 1346 def arguments @arguments end
The list of arguments, if present. These can be any non-void expressions.
foo(bar, baz)
^^^^^^^^
Flags
Public Instance Methods
() → bool
Source
# File lib/prism/node.rb, line 1301 def contains_forwarding? flags.anybits?(ArgumentsNodeFlags::CONTAINS_FORWARDING) end
if the arguments contain forwarding
() → bool
Source
# File lib/prism/node.rb, line 1317 def contains_keyword_splat? flags.anybits?(ArgumentsNodeFlags::CONTAINS_KEYWORD_SPLAT) end
if the arguments contain a keyword splat
() → bool
Source
# File lib/prism/node.rb, line 1309 def contains_keywords? flags.anybits?(ArgumentsNodeFlags::CONTAINS_KEYWORDS) end
if the arguments contain keywords
() → bool
Source
# File lib/prism/node.rb, line 1333 def contains_multiple_splats? flags.anybits?(ArgumentsNodeFlags::CONTAINS_MULTIPLE_SPLATS) end
if the arguments contain multiple splats
() → bool
Source
# File lib/prism/node.rb, line 1325 def contains_splat? flags.anybits?(ArgumentsNodeFlags::CONTAINS_SPLAT) end
if the arguments contain a splat
Node Interface
These methods are present on all subclasses of Node. Read the node interface docs for more information.
Public Class Methods
Public Instance Methods
(_Visitor visitor) → untyped
Source
# File lib/prism/node.rb, line 1224 def accept(visitor) visitor.visit_arguments_node(self) end
See Node.accept.
() → Array[node?]
Source
# File lib/prism/node.rb, line 1231 def child_nodes [*arguments] end
See Node.child_nodes.
Also aliased as: deconstruct
() → Array[node | Location]
Source
# File lib/prism/node.rb, line 1255 def comment_targets [*arguments] #: Array[Prism::node | Location] end
See Node.comment_targets.
() → Array[node]
Source
# File lib/prism/node.rb, line 1248 def compact_child_nodes [*arguments] end
(?node_id: Integer, ?location: Location, ?flags: Integer, ?arguments: Array[Prism::node]) → ArgumentsNode
Source
# File lib/prism/node.rb, line 1265 def copy(node_id: self.node_id, location: self.location, flags: self.flags, arguments: self.arguments) ArgumentsNode.new(source, node_id, location, flags, arguments) end
Creates a copy of self with the given fields, using self as the template.
() → Enumerator[node, void]
() { (node) → void } → void
Source
# File lib/prism/node.rb, line 1239 def each_child_node(&blk) return to_enum(:each_child_node) unless block_given? arguments.each { |node| yield node } end
See Node.each_child_node.
Repository
Methods related to Relocation.