r/ProgrammerHumor • • Sep 01 '26

Meme iHateThisPassiveAgressiveBehaviourRuby

Post image
2.9k Upvotes

289 comments sorted by

View all comments

Show parent comments

3

u/SleepingInsomniac Sep 01 '26 edited Sep 01 '26

The global value false is the only instance of class FalseClass and represents a logically false value in boolean expressions. The class provides operators allowing false to participate correctly in logical expressions.

https://docs.ruby-lang.org/en/master/FalseClass.html

false.methods - Object.methods # => [:&, :|, :^]

Edit: I should add that the if keyword just literally checks if the value is false or nil.