A faster way to check the sign of a number in Ruby on Rails
Ruby has two methods for checking the sign of a number: positive?
and negative?
. These methods were introduced in Ruby 2.3, and they provide a more concise and readable way to check the sign of a number than using comparison operators.