Skip to content

Instantly share code, notes, and snippets.

@bil-bas
Forked from drewdeponte/gist:3420790
Created August 22, 2012 00:46
Show Gist options
  • Select an option

  • Save bil-bas/3420977 to your computer and use it in GitHub Desktop.

Select an option

Save bil-bas/3420977 to your computer and use it in GitHub Desktop.
Require inside module try #1
# 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.
@bil-bas

bil-bas commented Aug 22, 2012

Copy link
Copy Markdown
Author

class Frog
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment