Module: RuboCop::AST::ParameterizedNode::WrappedArguments

Includes:
RuboCop::AST::ParameterizedNode
Included in:
BreakNode, NextNode, ReturnNode
Defined in:
lib/rubocop/ast/node/mixin/parameterized_node.rb

Overview

A specialized ‘ParameterizedNode` for node that have a single child containing either `nil`, an argument, or a `begin` node with all the arguments

Instance Method Summary collapse

Methods included from RuboCop::AST::ParameterizedNode

#arguments?, #block_argument?, #first_argument, #last_argument, #parenthesized?, #splat_argument?

Instance Method Details

#argumentsArray

Returns The arguments of the node.

Returns:

  • (Array)

    The arguments of the node.



69
70
71
72
73
74
75
76
# File 'lib/rubocop/ast/node/mixin/parameterized_node.rb', line 69

def arguments
  first = children.first
  if first&.begin_type?
    first.children
  else
    children
  end
end