Class: Rubocop::Cop::DefWithoutParentheses
- Includes:
- DefParentheses
- Defined in:
- lib/rubocop/cop/def_parentheses.rb
Constant Summary
Constants included from DefParentheses
Rubocop::Cop::DefParentheses::EMPTY_PARAMS
Instance Attribute Summary
Attributes inherited from Cop
Instance Method Summary collapse
Methods included from DefParentheses
Methods inherited from Cop
#add_offence, #has_report?, inherited, #initialize
Constructor Details
This class inherits a constructor from Rubocop::Cop::Cop
Instance Method Details
#check(tokens, def_sexp) ⇒ Object
47 48 49 50 51 |
# File 'lib/rubocop/cop/def_parentheses.rb', line 47 def check(tokens, def_sexp) if def_sexp[2][0] == :params && def_sexp[2] != EMPTY_PARAMS add_offence(:convention, def_sexp[1][-1].lineno, ) end end |
#error_message ⇒ Object
43 44 45 |
# File 'lib/rubocop/cop/def_parentheses.rb', line 43 def 'Use def with parentheses when there are arguments.' end |