Class: RuboCop::Cop::Kata::NoBooleanFlag
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Kata::NoBooleanFlag
- Defined in:
- lib/rubocop/cop/kata/no_boolean_flag.rb
Constant Summary collapse
- MSG =
"A boolean flag is two methods trapped in one; split them or name the argument."
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
6 7 8 9 |
# File 'lib/rubocop/cop/kata/no_boolean_flag.rb', line 6 def on_send(node) return if node.operator_method? || node.assignment_method? node.arguments.each { add_offense(it, message: MSG) if it.boolean_type? } end |