Created
June 11, 2019 21:17
-
-
Save enebo/cd74b135bc4a7cbbc4974f236c599384 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cls = [] | |
2.times do |i| | |
cls[i] = Class.new do | |
def go | |
autoload :Autoloaded, 'autoloaded' | |
p autoload? :Autoloaded | |
end | |
def it | |
self.class.const_get :Autoloaded | |
end | |
end | |
end | |
2.times do |i| | |
c = cls[i].new | |
c.go | |
p c | |
p c.class.constants | |
p c.it | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts "LOADED" | |
class Autoloaded | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment