class

String

v1.2.6 - Show latest stable - Superclass: Object

No documentation available for this class.

Files

  • activesupport/lib/active_support/core_ext/blank.rb
  • activesupport/lib/active_support/core_ext/string.rb

2Notes

constantize

eric_programmer · Jan 14, 20092 thanks

@ncancelliere - Instead use constantize which is provided as part of ActiveSupport. It is much easier. So:

mystring.constantize

Convert String to Class

ncancelliere · Jan 14, 2009

this example shows how you can take a string and # make it a class and then send it a method

Kernel.const_get(my_string.capitalize).select_options