def create_from_string(klass, string = "") # like calling String.new or something because # klass is a variable representing the class you passed in klass.new(string) end x = create_from_string(String, "dude") y = create_from_string(Regexp, "wat")