module RuboCop::AST::ParameterizedNode

def arguments?

Returns:
  • (Boolean) - whether this node has any arguments
def arguments?
  !arguments.empty?
end

def block_argument?

Returns:
  • (Boolean) - whether the last argument of the node is a block pass
def block_argument?
  arguments? &&
    (last_argument.block_pass_type? || last_argument.blockarg_type?)
end

def first_argument

Returns:
  • (Node, nil) - the first argument of the node,
def first_argument
  arguments[0]
end

def last_argument

Returns:
  • (Node, nil) - the last argument of the node,
def last_argument
  arguments[-1]
end

def parenthesized?

Returns:
  • (Boolean) - whether this node's arguments are
def parenthesized?
  loc.end&.is?(')')
end

def splat_argument?

Returns:
  • (Boolean) - whether the node is a splat argument
def splat_argument?
  arguments? &&
    (arguments.any?(&:splat_type?) || arguments.any?(&:restarg_type?))
end