Class: RuboCop::AST::NodePattern::Node::AnyOrder
Overview
Node class for ‘<int str …>`
Constant Summary
FunctionCall, MAP
Instance Method Summary
collapse
#in_sequence_head
#arity_range, #capture?, #child, #children_nodes, #in_sequence_head, #matches_within_set?, #nb_captures, #rest?, #source_range, #variadic?, #with
#def_delegators
#child_nodes, #descendants, #each_child_node, #each_descendant, #each_node
Instance Method Details
#arity ⇒ Object
197
198
199
200
201
|
# File 'lib/rubocop/ast/node_pattern/node.rb', line 197
def arity
return children.size unless ends_with_rest?
ARITIES[children.size]
end
|
#ends_with_rest? ⇒ Boolean
189
190
191
|
# File 'lib/rubocop/ast/node_pattern/node.rb', line 189
def ends_with_rest?
children.last.rest?
end
|
#rest_node ⇒ Object
193
194
195
|
# File 'lib/rubocop/ast/node_pattern/node.rb', line 193
def rest_node
children.last if ends_with_rest?
end
|
#term_nodes ⇒ Object
185
186
187
|
# File 'lib/rubocop/ast/node_pattern/node.rb', line 185
def term_nodes
ends_with_rest? ? children[0...-1] : children
end
|