Skip to content

Files

Latest commit

 

History

History
25 lines (17 loc) · 391 Bytes

Lint-FlipFlop.md

File metadata and controls

25 lines (17 loc) · 391 Bytes

Pattern: Use of deprecated flip-flop operator

Issue: -

Description

flip-flop operator is deprecated since Ruby 2.6.0.

Examples

# bad
(1..20).each do |x|
  puts x if (x == 5) .. (x == 10)
end

# good
(1..20).each do |x|
  puts x if (x >= 5) && (x <= 10)
end

Further Reading