Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在红宝石中,您可以:
do_stuff if foo == bar
从技术上讲,是否有一个&block捕获之前的代码块if?这东西是怎么工作的?
&block
if
它们不是方法,它们是关键字。它们的行为由语言规范定义,不受语言规则的限制。他们可以做任何他们想做的事。