I have the name of a class and I want to create an instance of that class so that I can loop through each rails attribute that is present in the schema of that class.
Try this:
Kernel.const_get("MyClass").new
Then to loop through an object's instance variables:
obj.instance_variables.each do |v| # do something end