Ruby LanguageTruthiness


Remarks

As a rule of thumb, avoid using double-negations in code. Rubocop says that double negations are unnecessarily complex and can often be replaced with something more readable.

Instead of writing

def user_exists?
    !!user
end

use

def user_exists?
    !user.nil?
end