-
-
Save bil-bas/3420977 to your computer and use it in GitHub Desktop.
Require inside module try #1
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
# code.rb contains: | |
# class Frog | |
# end | |
module MyModule | |
class_eval File.read("./code.rb"), "code.rb", 1 | |
end | |
p MyModule::Frog # Will succeed. | |
p Frog # Will fail. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
class Frog
end