How do I check If a Class already exists in Ruby
- by Jimmy
How do I check If a Class already exists in Ruby,
My code is:
puts "enter the name of the Class to see if it exists"
nameofclass=gets.chomp
eval (" #{nameofclass}...... Not sure what to write here")
I was thinking of using:
eval "#{nameofclass}ancestors. ....."