control_flow/bang_operator_parens.rb
tests/_examples/control_flow/bang_operator_parens.rb in the metorex repository.
# Bang (!) unary not operator (with parentheses)
x = true
y = false
puts(!x)
puts(!y)
puts(!nil)
puts(!!true)
puts(!false || true)
Output:
false
true
true
true
true