Common functionality for cops handling unused arguments.
# File lib/rubocop/cop/mixin/unused_argument.rb, line 18 def after_leaving_scope(scope, _variable_table) scope.variables.each_value do |variable| check_argument(variable) end end
# File lib/rubocop/cop/mixin/unused_argument.rb, line 11 def autocorrect(node) new_name = node.loc.expression.source.sub(/(\W?)(\w+)/, '\1_\2') @corrections << lambda do |corrector| corrector.replace(node.loc.expression, new_name) end end
Generated with the Darkfish Rdoc Generator 2.