-
-
Save mdedetrich/a6efbac7e0c7b5e823bc 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
class SomeClass | |
def self.create_class(id) | |
module_exec do | |
c = Class.new | |
const_set id,c | |
end | |
end | |
end | |
module TestModule | |
SomeClass.create_class(:TestClass) | |
end | |
puts TestModule::TestClass #should exist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment