Get the latest tech news
There is no such thing as a global method in Ruby
What Ruby’s top-level methods actually are, who they belong to and how they are namespaced
A few days ago, a curious question was asked on /r/ruby, which can be boiled down to this: How are the methods of the Kernel module available in the top-level scope? This is a clear and consistent system… Which might sometimes lead to extremely weird quirks with the metaprogramming code, which checks for some method’s presence by name and changes the behavior depending on it. (:avatar_url) —and in some completely unrelated place, a helper module was included into the global scope, which made all objects to have avatar_url method… But not the one that would be expected there in the serialization code.
Or read this on Hacker News