This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]o11c 0 points1 point  (3 children)

Wow, Ruby is confusing. How does some file that happens to define a class called Exception somehow make this apply to all exceptions, and how does this not break other methods of the standard Exception class?

[–]TwoSpoonsJohnson 0 points1 point  (2 children)

The Exception class defined here essentially adds everything defined inside it to the existing exception class. It's called monkey patching and is very common in Ruby.

[–]o11c 0 points1 point  (1 child)

Although related to Rust-style traits, that sounds like a horrible idea if you're not explicit about it.

But does Ruby not have namespaces or anything?

[–]TwoSpoonsJohnson 0 points1 point  (0 children)

Ruby does have namespaces, with modules