gpt4 book ai didi

ruby - 为变量赋值的 Ruby `if` block 的推荐缩进样式?

转载 作者:数据小太阳 更新时间:2023-10-29 07:25:09 25 4
gpt4 key购买 nike

<分区>

以下哪一个是更好的 Ruby 代码格式样式,为什么?

选项 A:

def load_business
@business ||= if params[:badge_uuid]
# some code
else
# some other code
end
end

选项 B:

def load_business
@business ||= if params[:badge_uuid]
# some code
else
# some other code
end
end

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com