class Rubocop::Cop::Style::DefWithoutParentheses
This cop checks for missing parentheses in the definition of a method, that takes arguments. Both instance and class/singleton methods are checked.
Constants
- MSG
Public Instance Methods
on_def(node)
click to toggle source
Calls superclass method
# File lib/rubocop/cop/style/def_parentheses.rb, line 48 def on_def(node) _, args = *node if args.children.size > 0 && args.loc.begin.nil? add_offence(:convention, args.loc.expression, MSG) end super end
on_defs(node)
click to toggle source
Calls superclass method
# File lib/rubocop/cop/style/def_parentheses.rb, line 58 def on_defs(node) _, _, args = *node if args.children.size > 0 && args.loc.begin.nil? add_offence(:convention, args.loc.expression, MSG) end super end