Ruby には次のようなコードがあります。
def check
if a == b || c == b
# execute some code
# b = the same variable
end
end
これは次のように書けますか
def check
if a || c == b
# this doesn't do the trick
end
if (a || c) == b
# this also doesn't do the magic as I thought it would
end
end
b
または、 2 回入力する必要がない方法で。これは怠惰からであり、知りたいです。