D
Don French
I have some working non rails standalone ruby code under ruby 1.8.6
using activesupport 2.3.5 to take a string and make it into a class
name. I was doing this:
require "active_support"
classes = []
classes << "health_report".classify.constantize
Now under ruby 1.9.2 and rails beta4 it fails. classify is not valid
and I am not sure of constantize. Is there a new way to take a name
of a file and make it into a class name so it can be used. I have a
list of ruby files that contain an individual class. I can require the
file but I do not know the name of the class. I was using the file
basename classified and constantized to create the class name that I
later can use.
Don French
using activesupport 2.3.5 to take a string and make it into a class
name. I was doing this:
require "active_support"
classes = []
classes << "health_report".classify.constantize
Now under ruby 1.9.2 and rails beta4 it fails. classify is not valid
and I am not sure of constantize. Is there a new way to take a name
of a file and make it into a class name so it can be used. I have a
list of ruby files that contain an individual class. I can require the
file but I do not know the name of the class. I was using the file
basename classified and constantized to create the class name that I
later can use.
Don French