

Discover more from Short Ruby Newsletter
A Monday summary of the articles, discussions, and news from the Ruby community
Over 3,000 subscribers
Continue reading
How constant lookup works in Ruby
#code #summary #ruby #how #constant #works #class #modules
This is a code summary for https://cirw.in/blog/constant-lookup
Code samples run on Ruby 3.1.2
Find all the code I used to generate images here.
You should also read the full article I summarised here as I did not include all examples from the article, but only the most important ones.
Further reading:
I also found a gist that explains some of how constant lookup works in Ruby with code: Constant Lookup in Ruby
And also, this discussion in the Ruby lang issue tracker is important if you want to understand how all works deep down: https://bugs.ruby-lang.org/issues/18622