class Prism::ArgumentsNode
Represents a set of arguments to a method or a keyword.
return foo, bar, baz
^^^^^^^^^^^^^
Public Class Methods
Source
# File lib/prism/node.rb, line 956 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
Source
# File lib/prism/node.rb, line 1069 def arguments @arguments end
The list of arguments, if present. These can be any non-void expressions.
foo(bar, baz)
^^^^^^^^
Flags
Public Instance Methods
Source
# File lib/prism/node.rb, line 1034 def contains_forwarding? flags.anybits?(ArgumentsNodeFlags::CONTAINS_FORWARDING) end
if the arguments contain forwarding
Source
# File lib/prism/node.rb, line 1046 def contains_keyword_splat? flags.anybits?(ArgumentsNodeFlags::CONTAINS_KEYWORD_SPLAT) end
if the arguments contain a keyword splat
Source
# File lib/prism/node.rb, line 1040 def contains_keywords? flags.anybits?(ArgumentsNodeFlags::CONTAINS_KEYWORDS) end
if the arguments contain keywords
Source
# File lib/prism/node.rb, line 1058 def contains_multiple_splats? flags.anybits?(ArgumentsNodeFlags::CONTAINS_MULTIPLE_SPLATS) end
if the arguments contain multiple splats
Source
# File lib/prism/node.rb, line 1052 def contains_splat? flags.anybits?(ArgumentsNodeFlags::CONTAINS_SPLAT) end
if the arguments contain a splat
Node Interface
Public Class Methods
Public Instance Methods
Source
# File lib/prism/node.rb, line 976 def accept(visitor) visitor.visit_arguments_node(self) end
See Node.accept.
Source
# File lib/prism/node.rb, line 981 def child_nodes [*arguments] end
See Node.child_nodes.
Also aliased as: deconstruct
Source
# File lib/prism/node.rb, line 998 def comment_targets [*arguments] #: Array[Prism::node | Location] end
See Node.comment_targets.
Source
# File lib/prism/node.rb, line 993 def compact_child_nodes [*arguments] end
Source
# File lib/prism/node.rb, line 1006 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.
Source
# File lib/prism/node.rb, line 986 def each_child_node return to_enum(:each_child_node) unless block_given? arguments.each { |node| yield node } end
See Node.each_child_node.