The Ruby Way, 2nd Edition, and a gotcha
This review of the The Ruby Way, Second Edition mentions one of Ruby’s fun little corners. To illustrate, what is the value of “doop” after this code?
x = true
y = false
doop = y or x
The correct answer is “false” because the “and” and “or” operators in Ruby have lower precedence then the assignment operator. […]
