跳至內容

作為後綴

if 可以寫成表達式的後綴

a = 2 if some_condition

# The above is the same as:
if some_condition
  a = 2
end

這有時會產生更自然易讀的程式碼。