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, #variadic?, #with

Methods included from Descendence

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

Instance Method Details

#arityObject



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

def arity
  ARITY
end

#in_sequence_headObject



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

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

#rest?Boolean

Returns:

  • (Boolean)


162
163
164
# File 'lib/rubocop/ast/node_pattern/node.rb', line 162

def rest?
  true
end