Class: RuboCop::AST::NodePattern::Node::Capture
- Inherits:
-
RuboCop::AST::NodePattern::Node
- Object
- Parser::AST::Node
- RuboCop::AST::NodePattern::Node
- RuboCop::AST::NodePattern::Node::Capture
- Defined in:
- lib/rubocop/ast/node_pattern/node.rb
Overview
Node class for ‘$something`
Constant Summary
Constants inherited from RuboCop::AST::NodePattern::Node
Instance Method Summary collapse
Methods inherited from RuboCop::AST::NodePattern::Node
#arity, #arity_range, #child, #children_nodes, #matches_within_set?, #rest?, #source_range, #variadic?, #with
Methods included from SimpleForwardable
Methods included from Descendence
#child_nodes, #descendants, #each_child_node, #each_descendant, #each_node
Instance Method Details
#capture? ⇒ Boolean
100 101 102 |
# File 'lib/rubocop/ast/node_pattern/node.rb', line 100 def capture? true end |
#in_sequence_head ⇒ Object
108 109 110 111 112 113 |
# File 'lib/rubocop/ast/node_pattern/node.rb', line 108 def in_sequence_head wildcard, original_child = child.in_sequence_head return unless original_child [wildcard, self] # ($...) => (_ $...) end |
#nb_captures ⇒ Object
104 105 106 |
# File 'lib/rubocop/ast/node_pattern/node.rb', line 104 def nb_captures 1 + super end |