Class: RuboCop::Cop::Style::DisallowSafeNavigation
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::Style::DisallowSafeNavigation
- Extended by:
- TargetRubyVersion
- Defined in:
- lib/rubocop/cop/style/disallow_safe_navigation.rb
Overview
The “safe navigation” operator &. makes it easier to work with and propagate nil values. This will disallow the safe navigation operator
Constant Summary collapse
- MSG =
'Do not use &.'.freeze
Instance Method Summary collapse
Instance Method Details
#on_csend(node) ⇒ Object
20 21 22 |
# File 'lib/rubocop/cop/style/disallow_safe_navigation.rb', line 20 def on_csend(node) add_offense(node) end |