Class: Rubocop::Cop::MultilineTernaryOperator
- 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
19 20 21 |
# File 'lib/rubocop/cop/ternary_operator.rb', line 19 def 'Avoid multi-line ?: (the ternary operator); use if/unless instead.' end |
#offends?(ifop) ⇒ Boolean
23 24 25 |
# File 'lib/rubocop/cop/ternary_operator.rb', line 23 def offends?(ifop) all_positions(ifop).map(&:lineno).uniq.size > 1 end |