Ruby variable assignment in a conditional “if” modifier

前端 未结 2 2031
孤城傲影
孤城傲影 2020-12-21 15:39

I have a question about how the Ruby interpreter assigns variables:

I use this quite often:

return foo if (foo = bar.some_method)

w

2条回答
提交回复
热议问题