Parent

Methods

Files

Class/Module Index [+]

Quicksearch

RuboCop::Cop::Style::OpMethod

This cop makes sure that certain operator methods have their sole parameter named `other`.

Public Instance Methods

on_def(node) click to toggle source
# File lib/rubocop/cop/style/op_method.rb, line 14
def on_def(node)
  name, args, _body = *node
  return unless name !~ /\A\w/ && !BLACKLISTED.include?(name) &&
    args.children.size == 1 && !TARGET_ARGS.include?(args)

  add_offense(args.children[0], :expression, format(MSG, name))
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.