I am pretty sure that there is no transcript for your second example, and cannot be written without changing the Ruby syntax, as this is not a common idiom. Sorry brother, but it looks like you have to be detailed on this. (Although, indeed, as far as verbosity goes, it's not so bad.)
(We also note that the first example is not quite right: x ||= a
equivalent to x = x || a
, which can also be expressed as x = a unless x
.)
source share