x if y如果z是真的我想运行,x unless y如果z是假的话.
x if y
z
x unless y
最惯用的方法是什么?我能想到的最好的是:
x if z ? y : !y
ruby idioms
idioms ×1
ruby ×1