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