Ruby - raise Exception.new or raise Exception - they're both the same | Arkency Blog

05-Dec-2019 1579
The way I’m raising the exception here is that I raise it without calling .new. This may look as if I’m raising a class, not an object.Some people asked me if this actually works and if it’s the same.We already know the short answer, so let’s dig into why it’s the same. Is there some kind of magic involved?One place to go is to check the raise (Kernel) - APIdock documentation.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle