Skip to content

Instantly share code, notes, and snippets.

@enebo
Created June 11, 2019 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save enebo/cd74b135bc4a7cbbc4974f236c599384 to your computer and use it in GitHub Desktop.
Save enebo/cd74b135bc4a7cbbc4974f236c599384 to your computer and use it in GitHub Desktop.
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
puts "LOADED"
class Autoloaded
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment