Class: Rubocop::Cop::NestedTernaryOperator
- Includes:
- TernaryOperator
- Defined in:
- lib/rubocop/cop/ternary_operator.rb
Instance Attribute Summary
Attributes inherited from Cop
Instance Method Summary collapse
Methods included from TernaryOperator
Methods inherited from Cop
#add_offence, #has_report?, inherited, #initialize
Constructor Details
This class inherits a constructor from Rubocop::Cop::Cop
Instance Method Details
#error_message ⇒ Object
31 32 33 34 |
# File 'lib/rubocop/cop/ternary_operator.rb', line 31 def 'Ternary operators must not be nested. Prefer if/else constructs ' + 'instead.' end |
#offends?(ifop) ⇒ Boolean
36 37 38 |
# File 'lib/rubocop/cop/ternary_operator.rb', line 36 def offends?(ifop) ifop.flatten[1..-1].include?(:ifop) end |