Thought this was really cool :)
def create_object(class_name, *args) the_class = Object.const_get(class_name) the_object = the_class.send :new, *args if !args.empty? the_object = the_class.send :new if args.empty? return the_object end
No comments:
Post a Comment