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 Descendence

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

Instance Method Details

#arityObject



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

def arity
  ARITY
end

#in_sequence_headObject



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

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

#rest?Boolean

Returns:

  • (Boolean)


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

def rest?
  true
end