Skip to content

Instantly share code, notes, and snippets.

@mdedetrich
Created June 3, 2013 08:38
Show Gist options
  • Save mdedetrich/a6efbac7e0c7b5e823bc to your computer and use it in GitHub Desktop.
Save mdedetrich/a6efbac7e0c7b5e823bc to your computer and use it in GitHub Desktop.
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