一行で条件分岐を書くために使われる
if
country = 'ja'
'日本' if country == 'ja'
# 日本
'日本' if country == 'jp'
# nil
unless
country = "us"
'その他の国' unless country == 'ja'
# その他の国
More than 5 years have passed since last update.
一行で条件分岐を書くために使われる
if
country = 'ja'
'日本' if country == 'ja'
# 日本
'日本' if country == 'jp'
# nil
unless
country = "us"
'その他の国' unless country == 'ja'
# その他の国
Register as a new user and use Qiita more conveniently