I have a program that create classes which looks like:
MyClass = Class.new do
def initialize; end
"hello_world".classify # => "HelloWorld"
Not sure if your question is only about constructing a camelcased string, or also about assigning a newly created class to it. Because, for the latter, you should use
class_name = 'MyClass' #=> "MyClass" klass = Class.new do def foo "foo" end end #=> #<Class:0xa093a68> Object.const_set class_name, klass #=> Module::MyClass MyClass.new.foo #=> "foo"