Class: RuboCop::AST::NodePattern::Node::Rest

Inherits:
RuboCop::AST::NodePattern::Node show all
Defined in:
lib/rubocop/ast/node_pattern/node.rb

Overview

Node class for ‘…`

Constant Summary

Constants inherited from RuboCop::AST::NodePattern::Node

FunctionCall, MAP

Instance Method Summary collapse

Methods inherited from RuboCop::AST::NodePattern::Node

#arity_range, #capture?, #child, #children_nodes, #matches_within_set?, #nb_captures, #source_range, #variadic?, #with

Methods included from SimpleForwardable

#def_delegators

Methods included from Descendence

#child_nodes, #descendants, #each_child_node, #each_descendant, #each_node

Instance Method Details

#arityObject



169
170
171
# File 'lib/rubocop/ast/node_pattern/node.rb', line 169

def arity
  ARITY
end

#in_sequence_headObject



173
174
175
# File 'lib/rubocop/ast/node_pattern/node.rb', line 173

def in_sequence_head
  [Node.new(:wildcard), self]
end

#rest?Boolean

Returns:

  • (Boolean)


165
166
167
# File 'lib/rubocop/ast/node_pattern/node.rb', line 165

def rest?
  true
end