If you are using ActiveSupport (part of Rails), you can actually use the #demodulize method on the String class.
http://apidock.com/rails/String/demodulize
bar.class.name.demodulize
If you are using ActiveSupport (part of Rails), you can actually use the #demodulize method on the String class.
http://apidock.com/rails/String/demodulize
bar.class.name.demodulize