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

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.
Ruby - raise Exception.new or raise Exception - they're both the same | Arkency Blog #ruby #rubydeveloper #rubyonrails #blog https://rubyonrails.ba/single/ruby-raise-exception-new-or-raise-exception-they-re-both-the-same-arkency-blog

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles