Module: RuboCop::Cop::EmptyParameter
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Macros
|
|
Defined in: | lib/rubocop/cop/mixin/empty_parameter.rb |
Overview
Common code for empty parameter cops.
Instance Method Summary
- #check(node) private
- #empty_arguments?(node) private
Instance Method Details
#check(node) (private)
[ GitHub ]# File 'lib/rubocop/cop/mixin/empty_parameter.rb', line 16
def check(node) empty_arguments?(node) do |args| return if args.empty_and_without_delimiters? add_offense(args) { |corrector| autocorrect(corrector, args) } end end
#empty_arguments?(node) (private)
[ GitHub ]# File 'lib/rubocop/cop/mixin/empty_parameter.rb', line 12
def_node_matcher :empty_arguments?, <<~PATTERN (block _ $(args) _) PATTERN