एक अजीब मामला देखा आ, यहाँ क्या हो रहा है पता लगाने की कोशिश:ब्लॉक वाक्य रचना अंतर का कारण बनता है "LocalJumpError: कोई (उपज) दिए गए ब्लॉक"
> def test
> p yield
> end
=> nil
> test { 1 }
1
=> 1
> p test { 1 }
1
1
=> 1
> p test do
> 1
> end
LocalJumpError: no block given (yield)
यहां जवाब है ... http://stackoverflow.com/questions/533008/what-is-the-difference-or-value-of-these-block-coding-styles-in-ruby/533040# 533040 –
यहां उत्तर है - http://stackoverflow.com/questions/2122380/using-do-block-vs-brackets?lq=1 –
यही कारण है कि आप ब्रांड्स का उपयोग करते हैं, भले ही रूबी आपको चुनने देता है। – Linuxios