I cant seem to follow this answer but maybe it's different from what I'm trying to achieve.
I have a string, that string can be different at time, I need to convert that string into a defined method name:
action = "get_name"
# The method
def get_name
puts "James"
end
# Calling the method
action # => undefined method `action' for main:Object
action
can be any of my defined methods and the names are in a string format. Could I say action.to_method
, you get what I mean ;)
I dont think I could say action.to_sym
?