Answer the question
In order to leave comments, you need to log in
How safe is it to use send() on user input?
There is a class:
class Klass
def method1(opts={})
end
def method2(*args)
end
end
Klass.send(user_input_method_name, user_input_args) if user_input_method_name.in?(Klass.public_methods(false))
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question