In short, these methods are used for meta-goals (for example, error reporting), as well as for ordinary purposes, so they are more important than other methods.
When something goes wrong, Ruby returns an error message and return paths. By default, an error message displays a scan of the intruder object. With the exception of a few special classes, such as String and Numeric , validation displays the identifier of the object. To correctly display error messages, it is important to have object_id . If it has not been defined, then the error display procedure itself will cause an error that must be displayed, which causes an infinite loop that cannot be reported. In such a situation, you cannot say what is going wrong. This is serious.
Perhaps the same can be said for __send__ . This is the underlying method of send for most classes, and is crucial when sending instructions to objects.
source share